0

Estoy intentano ejecutar un proyecto android en react native y me encuentro con el siguiente error:

:app:processDebugManifest /Users/me/project/android/app/src/main/AndroidManifest.xml:28:13-35 Error: Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:appcompat-v7:26.0.2] AndroidManifest.xml:28:13-35 is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:app:processDebugManifest FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:appcompat-v7:26.0.2] AndroidManifest.xml:28:13-35 is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:26:9-28:38 to override.

Este es mi Manifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:allowBackup="true"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.intent.action.DOWNLOAD_COMPLETE"/> 
    </intent-filter>
  </activity>
  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

Este es mi build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "project.com"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 27
        versionName "5.1.1"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    applicationVariants.all { variant ->
        variant.outputs.each { output ->

            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile (project(':pushwoosh-react-native-plugin'))
    {
      exclude group: 'com.google.android.gms'
    }
    compile project(':react-native-google-analytics-bridge')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-video')
    compile("com.google.firebase:firebase-messaging:11.8.0") {
        force = true
    }
    compile("com.google.firebase:firebase-core:11.8.0") {
        force = true
    }
    compile("com.google.android.gms:play-services-gcm:11.8.0") {
        force = true
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:26.0.2"
    compile "com.facebook.react:react-native:+"
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'

Me han sugerido añadir al manifest tools:replace="android:value" pero esto no resuelve mi problema.

1
  • Prueba a cambiar en el build.gradle esta línea compile "com.android.support:appcompat-v7:26.0.2" por esta compile "com.android.support:appcompat-v7:26.1.0" y el buildToolsVersion "26.0.2" por buildToolsVersion "26.1.0"
    – Wyrncael
    Commented el 4 abr. 2018 a las 12:33

2 respuestas 2

0

Revisa el mensaje de error:

Error: Attribute meta-data#android.support.VERSION@value value=(26.0.2) from [com.android.support:appcompat-v7:26.0.2] AndroidManifest.xml

Sugiere definir el meta dato conteniendo el valor de la versión, por lo tanto agrega dentro de <application> en tu archivo AndroidManifest.xml:

   ...
   ...
   <meta-data
       tools:replace="android:value"
       android:name="android.support.VERSION"
       android:value="26.0.2" />

</application>
9
  • Cuando se califique con -1, es bueno para el sitio se indique la razón, esto para mejorar la pregunta, eliminarla o si existen argumentos platicar sobre el tema.
    – Jorgesys
    Commented el 3 abr. 2018 a las 17:33
  • Gracias por la respuesta @Jorgesys Commented el 4 abr. 2018 a las 14:45
  • Hola @JhonmerAraujo comenta si te fue de ayuda al implementar esta solución
    – Jorgesys
    Commented el 4 abr. 2018 a las 14:46
  • No, me devuelve lo siguiente: El prefijo "tools" para el atributo "tools:replace" asociado a un tipo de elemento "meta-data" no está enlazado. Commented el 4 abr. 2018 a las 14:48
  • @JhonmerAraujo lo agregaste en tu AndroidManifest.xml dentro de <application> ?
    – Jorgesys
    Commented el 4 abr. 2018 a las 14:49
-1

no te preocupes te ayudo a modificarlo y listo ;3

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.2"

    defaultConfig {
        applicationId "project.com"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 27
        versionName "7.1.3"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x58"
        }
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    applicationVariants.all { variant ->
        variant.outputs.each { output ->

            def versionCodes = ["armeabi-v7a":1, "x82":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 162156 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile (project(':pushwoosh-react-native-plugin'))
    {
      exclude group: 'com.google.android.jhs'
    }
    compile project(':react-native-google-analytics-bridge')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-video')
    compile("com.google.firebase:firebase-messaging:15.2.0") {
        force = true
    }
    compile("com.google.firebase:firebase-core:51.9.0") {
        force = true
    }
    compile("com.google.android.gms:play-services-gcm:11.8.0") {
        force = true
    }
    compile fileTree(dir: "lytr", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:15.8.7"
    compile "com.facebook.react:react-native:+"
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'

de nada :3

1
  • Gracias por tu interés en participar en la comunidad Yaz!, te sugiero revisar Cómo responder. Saludos!
    – Jorgesys
    Commented el 3 abr. 2018 a las 16:35

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.