清单合并因多个错误而失败

时间:2017-08-21 07:33:42

标签: android android-gradle android-manifest

当我将Android Build Tools版本转换为26.0.0并添加元数据时出现以下错误:

  1. Facebook。
  2. 织物。
  3.   

    编译'com.google.android.gms:play-services:11.0.4'

    错误是:

      

    错误:任务':app:processDebugManifest'的执行失败。    清单合并失败,出现多个错误,请参阅日志

    我的宣言:

    <?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>
    

    我的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'
    }
    

    错误日志:

      

    2017-08-21 10:45:47,158 [61689741] DEBUG - com.crashlytics - Frame   为项目激活:项目   'G:\ ArabSoog \ ArabSoog \ ArabSooqApplication'ArabSooqApplication

         

    2017-08-21 10:45:49,204 [61691787] INFO -   ild.invoker.GradleBuildInvoker - 即将执行Gradle任务:   [clean,:app:generateDebugSources,   :app:generateDebugAndroidTestSources,:app:mockableAndroidJar,   :app:prepareDebugUnitTestDependencies]

         

    2017-08-21 10:45:49,210 [61691793] INFO -   s.plugins.gradle.GradleManager - 指示gradle使用java   C:/ Program Files / Android / Android Studio / jre

         

    2017-08-21 10:45:49,273 [61691856] INFO -   ild.invoker.GradleBuildInvoker - 构建命令行选项:   [--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 - 将命令行参数传递给Gradle   工具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 - 项目根已更改

         

    2017-08-21 10:45:50,594 [61693177] INFO -   .diagnostic.PerformanceWatcher - 推送属性需要3ms;一般   响应性:好的; EDT响应:好的

         

    2017-08-21 10:45:50,610 [61693193] INFO -   .diagnostic.PerformanceWatcher - 可索引文件迭代耗时16ms;   一般回应:好的; EDT响应:好的

         

    2017-08-21 10:45:50,610 [61693193] INFO -   indexing.UnindexedFilesUpdater - 未编制索引的文件已更新:2   要更新的文件

         

    2017-08-21 10:45:50,687 [61693270] INFO -   .diagnostic.PerformanceWatcher - 未编制索引的文件更新耗时77毫秒;   一般回应:好的; EDT响应:好的

1 个答案:

答案 0 :(得分:2)

我从Manifest

中删除了这一行
  

工具:替换=&#34;机器人:值= 25.3.1&#34;

并在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'
            }
        }
    }
}

使用此资源: Comments