简体   繁体   中英

Manifest merger failed with multiple errors

I have the following error when I has converted the Android Build Tools Version to 26.0.0 and add the metadata for:

  1. Facebook .
  2. Fabric.

compile 'com.google.android.gms:play-services:11.0.4'

The Error Is :

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed with multiple errors, see logs

My Manifest :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="moments.com.arabsooq"
    android:installLocation="auto">

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

    <uses-feature
        android:name="android.hardware.camera" android:required="true" />

    <application
        android:allowBackup="true"
        android:fullBackupContent="true"
        android:icon="@mipmap/ic_launcherr"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcherr"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity
            android:name=".activities.SplashScreen"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.MainActivity"
            android:label="@string/title_activity_main"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme">
            <intent-filter android:label="@string/app_name_ar">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="www.arabsoog.com"
                    android:pathPrefix="/create"
                    android:scheme="http" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.ChooseCountry"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.LoginChooser"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.SubCategory"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.Advertisments"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.ProductAct"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.AddAd"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.Search"
            android:label="@string/title_activity_search"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".activities.DoneAdd"
            android:screenOrientation="portrait"
            android:theme="@style/MyAlertDialogStyle" />
        <activity
            android:name=".activities.MyProfile"
            android:label="@string/title_activity_my_profile"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.SearchResult"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.MyFave"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.UpdateAdd"
            android:screenOrientation="portrait" />
        <activity
            android:name=".activities.AboutApp"
            android:screenOrientation="portrait"
            android:theme="@style/MyAlertDialogStyle" />
        <activity
            android:name=".activities.Contact_User"
            android:screenOrientation="portrait"
            android:theme="@style/MyAlertDialogStyle" />
        <activity
            android:name=".activities.MyAds"
            android:label="@string/title_activity_my_ads"
            android:theme="@style/AppTheme" />

        <service
            android:name=".services.MyFirebaseInstanceIDService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name=".services.MyFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" />
        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>

        <meta-data
            tools:replace="android:value=25.3.1"
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name=".activities.Zoom"
            android:theme="@style/MyAlertDialogStyle" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="83b5fdfbb15ad6f9567027ae5a20c3fe99e2cedf" />

    </application>

</manifest>

My Gradle :

    buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.24.1'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "moments.com.arabsooq"
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 23
        versionName "0.0.14"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.6@aar') {
        transitive = true;
    }
    compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'

    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    compile 'com.android.volley:volley:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.tasomaniac:delayed-progress:0.4'
    compile 'com.taishi-y:flipprogressdialog:0.1.0'
    compile 'net.gotev:uploadservice:3.2.4'
    compile 'net.gotev:uploadservice-okhttp:3.2.4'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'xyz.dev_juyoung:cropicker:1.0.3'
    compile 'com.reginald.swiperefresh:library:1.1.2'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.daimajia.easing:library:2.0@aar'
    compile 'com.daimajia.androidanimations:library:2.3@aar'
    compile 'com.nispok:snackbar:2.6.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    compile 'com.google.firebase:firebase-crash:11.0.4'
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.google.firebase:firebase-ads:11.0.4'
    compile 'com.google.android.gms:play-services-ads:11.0.4'
    compile 'com.google.android.gms:play-services:11.0.4'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'
crashlytics {
    enableNdk true
    androidNdkOut 'src/main/obj'
    androidNdkLibsOut 'src/main/libs'
}

Error Log :

2017-08-21 10:45:47,158 [61689741] DEBUG - com.crashlytics - Frame activated for project: Project 'G:\\ArabSoog\\ArabSoog\\ArabSooqApplication' ArabSooqApplication

2017-08-21 10:45:49,204 [61691787] INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]

2017-08-21 10:45:49,210 [61691793] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre

2017-08-21 10:45:49,273 [61691856] INFO - ild.invoker.GradleBuildInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.generateSourcesOnly=true, --init-script, C:\\Users\\HAMZAA~1\\AppData\\Local\\Temp\\asLocalRepo4354.gradle]

2017-08-21 10:45:49,273 [61691856] INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.generateSourcesOnly=true, --init-script, C:\\Users\\HAMZAA~1\\AppData\\Local\\Temp\\asLocalRepo4354.gradle]

2017-08-21 10:45:50,510 [61693093] INFO - pl.ProjectRootManagerComponent - project roots have changed

2017-08-21 10:45:50,594 [61693177] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 3ms; general responsiveness: ok; EDT responsiveness: ok

2017-08-21 10:45:50,610 [61693193] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 16ms; general responsiveness: ok; EDT responsiveness: ok

2017-08-21 10:45:50,610 [61693193] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 2 files to update

2017-08-21 10:45:50,687 [61693270] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 77ms; general responsiveness: ok; EDT responsiveness: ok

I was removed this line from Manifest :

tools:replace="android:value=25.3.1"

and using this code in 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 '25.3.0'
            }
        }
    }
}

using this resourse : Comments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM