清单合并失败,并出现多个错误,请在生成签名的APK

时间:2018-09-13 10:45:37

标签: android merge apk manifest release

生成Release apk时总是出现此错误。这个问题我真的很震惊。我已经尝试了所有可能的Stack Overflow解决方案,但都没有成功。

我不知道我要去哪里错了。

Build.gradel

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

        dependencies {
            classpath 'io.fabric.tools:gradle:1.+'
        }
        }
    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'

    repositories {
        maven { url 'https://maven.fabric.io/public' }
        }
    android
            {
                compileSdkVersion 27
                defaultConfig {
                    applicationId "******************"
                    minSdkVersion 19
                    targetSdkVersion 27
                    versionCode 1
                    versionName "1.0"
                    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
                    multiDexEnabled true
                    //buildConfigField "String", "BASEURL", "\"http://50.31.147.142/IGLLiveApi/api/\""
                    // buildConfigField "String", "BASEURL", "\"https://raw.githubusercontent.com/rrafols/mobile_test/master/\""

                    javaCompileOptions {
                        //This will write out the schema to a schemas subfolder of your project folder.
                        annotationProcessorOptions {
                            arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
                        }
                    }
                    buildConfigField "int", "LIMIT", "100"
                    buildConfigField "int", "CACHETIME", "432000" // 5days


                    vectorDrawables.useSupportLibrary = true

                }
                signingConfigs {

                    config {
                        keyAlias 'name'
                        keyPassword '*****'
                        storeFile file('/Volumes/D_Drive/Android_workspace/Igllpm_new/keyStore/IGLLPM.jks')
                        storePassword '*****'
                    }
                }
                compileOptions {
                    sourceCompatibility JavaVersion.VERSION_1_8
                    targetCompatibility JavaVersion.VERSION_1_8
                }

                buildTypes
                        {
                            dev {
                                versionNameSuffix "-Dev"
                                //buildConfigField "String", "END_POINT", '"http://192.168.2.237/API_DEV/api/"'
                                buildConfigField "String", "BASEURL", "\"http://*************\""
                                manifestPlaceholders = [mapApiKeyValue: "*********************"]
                                buildConfigField "String", "DIRECTION_API_KEY", "\"***********************\""
                                debuggable true
                                ext.betaDistributionEmailsFilePath = '../release-notes/release_1_7.txt'
                                signingConfig signingConfigs.config

                            }
                            prod {
                                versionNameSuffix "-Prod"
                               // buildConfigField "String", "BASEURL", "\"http://********************/ \""
                                buildConfigField "String", "BASEURL", "\"http://********************\""
                                manifestPlaceholders = [mapApiKeyValue: "*************************"]
                                buildConfigField "String", "DIRECTION_API_KEY", "\"**********************\""

                                debuggable true
                                ext.betaDistributionEmailsFilePath = '../release-notes/release_1_7.txt'
                                signingConfig signingConfigs.config

                                shrinkResources true
                                minifyEnabled true
                                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                            }
                            release {
                                // signingConfig signingConfigs.release
                                shrinkResources true
                                minifyEnabled true
                                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                            }
                        }
                buildToolsVersion '27.0.3'

            }

    dependencies {
        def lifecycle_version = "1.1.1"
        def workVersion = "1.0.0-alpha04"

        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:27.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        implementation 'com.android.support:support-vector-drawable:27.1.1'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        androidTestImplementation 'com.android.support:support-annotations:26.1.0'
        // android
        implementation 'com.android.support:support-v4:27.1.1'
        implementation 'com.android.support:recyclerview-v7:27.1.1'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:cardview-v7:27.1.1'
        //Networking
        implementation 'com.facebook.stetho:stetho-okhttp3:1.4.2'
        implementation 'com.google.code.gson:gson:2.8.2'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
        implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
        //Depandencies injection
        implementation 'com.google.dagger:dagger:2.5'
        annotationProcessor 'com.google.dagger:dagger-compiler:2.5'
        compileOnly 'javax.annotation:jsr250-api:1.0'
        implementation 'com.jakewharton:butterknife:8.5.1'
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
        //Room
        implementation "android.arch.persistence.room:runtime:$lifecycle_version"
        annotationProcessor "android.arch.persistence.room:compiler:$lifecycle_version"
        implementation "android.arch.lifecycle:runtime:$lifecycle_version"
        implementation "android.arch.lifecycle:common-java8:$lifecycle_version"
        implementation "android.arch.lifecycle:extensions:$lifecycle_version"

        implementation "android.arch.lifecycle:livedata:1.1.1"
        annotationProcessor "android.arch.lifecycle:compiler:1.1.1"

        //Firebase
        implementation 'com.google.firebase:firebase-core:16.0.1'
        implementation 'com.google.firebase:firebase-messaging:17.1.0'

        //audio file
        implementation 'commons-io:commons-io:2.6'

        // RxJava support for Room
        //implementation "android.arch.persistence.room:rxjava2:1.0.0"
        //Rx
    //    compile 'io.reactivex.rxjava2:rxjava:2.1.0'
    //    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    //    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
        //Image Loading Library
        implementation 'de.hdodenhof:circleimageview:2.2.0'
        implementation 'com.github.bumptech.glide:glide:4.4.0'
        annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
        implementation('com.github.bumptech.glide:recyclerview-integration:4.4.0') {
            // Excludes the support library because it's already included by Glide.
            transitive = false
        }
        // crashlytics
        implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
            transitive = true;
        }

        // maps
        implementation 'com.google.android.gms:play-services-base:15.0.1'
        implementation 'com.google.android.gms:play-services-maps:15.0.1'
        implementation 'com.google.android.gms:play-services-identity:15.0.1'
        implementation 'com.google.android.gms:play-services-location:15.0.1'
        implementation 'com.google.android.gms:play-services-vision:15.0.2'
        implementation 'com.akexorcist:googledirectionlibrary:1.1.1' // directions with waypoints

        implementation 'com.google.maps.android:android-maps-utils:0.5'
        // location api
        implementation 'io.nlopez.smartlocation:library:3.3.3'

        // WorkManager for background service
        implementation "android.arch.work:work-runtime:$workVersion"
        implementation 'com.android.support:multidex:1.0.1'

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

错误日志

org.gradle.api.tasks.TaskExecutionException:任务':app:processReleaseManifest'的执行失败。     在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)     在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)     在org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)处     在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)     在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)     在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)     在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)     在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)     在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)处     在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)     在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)     在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)     在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)     在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker $ 1.run(DefaultTaskGraphExecuter.java:248)     在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处     在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)     在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)     在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)     在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)处     在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)处     在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)处     在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.access $ 200(DefaultTaskPlanExecutor.java:79)     在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:104)     在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:98)     在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)处     在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)处     在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)     在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)     在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)     在java.lang.Thread.run(Thread.java:745) 由以下原因引起:java.lang.RuntimeException:清单合并失败,出现多个错误,请参阅日志     在com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:524)     在com.android.build.gradle.tasks.MergeManifests.doFullTask​​Action(MergeManifests.java:143)     在com.android.build.gradle.internal.tasks.IncrementalTask​​.taskAction(IncrementalTask​​.java:106)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处     在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)     在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)     在org.gradle.api.internal.project.taskfactory.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:46)     在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)     在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)     在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:121)     在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处     在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)     在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)     在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)     在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)处     在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)     ...另外32个

清单

<?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="knowledgeflex.com.iglindraprasthagaslimited">

    <permission
        android:name="knowledgeflex.com.iglindraprasthagaslimited.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    <uses-permission
        android:name="android.permission.USE_CREDENTIALS"
        android:maxSdkVersion="27" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.LOCATION_FINE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_SYNC_STATS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <permission
        android:name="knowledgeflex.com.iglindraprasthagaslimited.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="knowledgeflex.com.iglindraprasthagaslimited.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

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

    <uses-feature android:name="android.hardware.location.gps" />

    <application
        android:name="knowledgeflex.com.iglindraprasthagaslimited.ApplicationController"
        android:allowBackup="false"
        android:icon="@mipmap/igl_logo"
        android:roundIcon="@mipmap/igl_logo_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.NoActionBar"
        >
        <activity
            android:name=".component.splash.SplashActivity"
            android:launchMode="singleInstance">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".component.login.LoginActivity" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="5c4b7fcc03167dc7ce1eaf7917d2a894a41e48cd" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="${mapApiKeyValue}" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".component.help.HelpPageActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.NoActionBar" />

        <service android:name=".firebase.IglMessageReceivingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name=".firebase.IglFirebaseInstanceIDService"
            tools:ignore="ExportedService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name="com.google.firebase.messaging.FirebaseMessagingService"
            android:exported="true"
            tools:ignore="ExportedService">
            <intent-filter android:priority="-500">
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.fc.debug" />
            </intent-filter>
        </receiver>



        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="knowledgeflex.com.iglindraprasthagaslimited.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

        <activity android:name=".component.lpm.LpmDashboardActivity" />

        <service
            android:name=".syncadapter.SyncService"
            android:exported="true">

            <!-- android:process=":sync" -->
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>

            <meta-data
                android:name="android.content.SyncAdapter"
                android:resource="@xml/sync_adapter" />
        </service>
        <service android:name=".syncadapter.AuthenticatorService">
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator" />
            </intent-filter>

            <meta-data
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/authenticator" />
        </service>

        <provider
            android:name=".syncadapter.SyncContentProvider"
            android:authorities="knowledgeflex.com.iglindraprasthagaslimited.android.syncadapter.provider"
            android:exported="true"
            android:label="@string/app_name"
            android:readPermission="true"
            android:syncable="true"
            android:writePermission="true" />

        <activity android:name=".component.bikereading.BikeReadingActivity" />
        <activity
            android:name=".component.home.HomeActivity"
            android:label="@string/title_activity_home" />

        <service
            android:name=".gps.GpsTrackingService"
            android:enabled="true" />
        <service
            android:name=".gps.GpsPingWorkManager"
            android:enabled="true" />

        <receiver
            android:name=".gps.LocationRestarterBroadcastReceiver"
            android:enabled="true"
            android:exported="true"
            android:label="RestartServiceWhenStopped">
            <intent-filter>
                <action android:name="knowledgeflex.com.iglindraprasthagaslimited.gps.restart.service" />
            </intent-filter>
        </receiver>

        <activity android:name=".component.checkmarker.CheckMarkerActivity" />
        <activity android:name=".component.checkmarker.updatemarker.UpdateMarkerActivity" />
        <activity android:name=".component.incident.AddIncidentActivity" />
        <activity android:name=".component.incident.updateincident.UpdateIncidentActivity" />
        <activity android:name=".component.healthreport.AddKhairiyatReportActivity" />
        <activity android:name=".base.AudioActivity" />
        <activity android:name=".component.incident.closeIncident.CloseIncidentActivity" />
        <activity android:name=".component.checkmarker.closeMarker.CloseMarkerActivity" />
        <activity android:name=".component.sv_dashboard.SvDashboardActivity"></activity>
        <activity android:name=".component.sv_dashboard.SvKhariyatActivity"></activity>
        <activity android:name=".component.cng_dashboard.CngKhariyatActivity"></activity>
        <activity android:name=".component.cng_dashboard.CngDashboardActivity"></activity>

        <receiver android:name="knowledgeflex.com.iglindraprasthagaslimited.gps.AlarmBootReceiver"
            android:enabled="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"></action>
            </intent-filter>
        </receiver>
        <receiver android:name="knowledgeflex.com.iglindraprasthagaslimited.base.AlarmSyncReceiver">

        </receiver>


    </application>

</manifest>

谢谢!

0 个答案:

没有答案