1

Quando em meu console dou o comando para compilar meu projeto em Ionic e Cordova, me volta a mensagem seguinte:

:mergeArmv7DebugResources UP-TO-DATE
        :processArmv7DebugManifestC:\apps\vovocooks-v10\platforms\android\AndroidManifest.xml:28:13-35 Error:
                Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:appcompat-v7:26.1.0]
        AndroidManifest.xml:28:13-35
                is also present at [com.android.support:support-v13:26.0.2] AndroidManifest.xml:28:13-35 value=(26.0.2).
                Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to
        override.


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

        :processArmv7DebugManifest FAILED

        FAILURE: Build failed with an exception.

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

        * Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

        BUILD FAILED

        Total time: 3.75 secs
        Error: cmd: Command failed with exit code 1 Error output:
        C:\apps\vovocooks-v10\platforms\android\AndroidManifest.xml:28:13-35 Error:
                Attribute meta-data#android.support.VERSION@value value=(26.1.0) from [com.android.support:appcompat-v7:26.1.0]
        AndroidManifest.xml:28:13-35
                is also present at [com.android.support:support-v13:26.0.2] AndroidManifest.xml:28:13-35 value=(26.0.2).
                Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to
        override.

        FAILURE: Build failed with an exception.

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

        * Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

No inicio achei que o problema era o google.service.jason do FCM do Google Messenge, arrumei ele, mas agora está em alguma configuração de meu AndroidManifest.xml, que está desta forma:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10502" android:versionName="1.5.2" package="com.ionicframework.vovocooksv7862011" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_stat_ic_notification" />
        <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/colorAccent" />
        <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id" />
        <activity android:label="@string/app_name" android:launchMode="singleTop" android:name="com.google.firebase.quickstart.fcm.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
        </provider>
        <receiver android:name="cordova.plugins.Diagnostic$LocationProviderChangedReceiver">
            <intent-filter>
                <action android:name="android.location.PROVIDERS_CHANGED" />
            </intent-filter>
        </receiver>
        <receiver android:name="cordova.plugins.Diagnostic$NFCStateChangedReceiver">
            <intent-filter>
                <action android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />
            </intent-filter>
        </receiver>
        <provider android:authorities="${applicationId}.sharing.provider" android:exported="false" android:grantUriPermissions="true" android:name="nl.xservices.plugins.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharing_paths" />
        </provider>
        <activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" />
        <receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" />
        <receiver android:name="com.adobe.phonegap.push.PushDismissedHandler" />
        <service android:name="com.adobe.phonegap.push.FCMService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <service android:name=".MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service android:name=".MyFirebaseInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <service android:exported="false" android:name=".MyJobService">
            <intent-filter>
                <action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
            </intent-filter>
        </service>
    </application>
    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-feature android:name="android.hardware.location.gps" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
</manifest>

Já procurei em foruns e até mesmo na documentação do FCM, mas não consigo solucionar. Como posso resolver?

2 Respostas 2

1

Você deve estar usando varias versões SDKs do Android.

Adicione isto no final do arquivo build.gradle

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.0.2'
            }
        }
    }
}

Outra opção

Altere no AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ionicframework.vovocooksv7862011"
    xmlns:tools="http://schemas.android.com/tools">

E adicione na tag application

tools:replace="android:value"
1
  • Obrigado @Wéllingthon! :)
    – Ramos
    10/10/2017 às 13:24
0

Resolvi, além do que mencionado pelo @Wéllingthon M. de Souza, Alterei os valores que estavam como "null" em:

apply from: 'CordovaLib/cordova.gradle'
    // The value for android.compileSdkVersion.
    if (!project.hasProperty('cdvCompileSdkVersion')) {
        cdvCompileSdkVersion = 23;
    }
    // The value for android.buildToolsVersion.
    if (!project.hasProperty('cdvBuildToolsVersion')) {
        cdvBuildToolsVersion = "23.0.2";
    }

E também acrescentei como mencionado na dica, porém com a versão 23:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '23.0.1'
        }
        }
    }
}

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .