Entry name 'AndroidManifest.xml' collided (Build failed after updating the android gradle plugin to 3.6.0)

前端 未结 6 1517
囚心锁ツ
囚心锁ツ 2021-02-04 02:02

I have recently updated the Android Studio from 3.5(stable) to 3.6(stable).

Then I saw the plugin update was also available, so I have updated the version of "com.an

6条回答
  •  孤街浪徒
    2021-02-04 02:34

    There are few methods to resolve this issue.

    1. Revert build.gradle version to 3.5.3

      dependencies {
             // classpath 'com.android.tools.build:gradle:3.6.1'       
                classpath 'com.android.tools.build:gradle:3.5.3'
              }
      
    2. Add packagingOptions under app/build.gradle

      android {
         ...
      
        packagingOptions {
            exclude 'AndroidManifest.xml'
        }
      
       }
      
    3. Under gradle.properties, set useNewApkCreator to false. Adding this flag might cause some apk installation issues.

      android.useNewApkCreator=false
      

    Final approach, perform a scan through third-party library. Check for androidx.core:core-ktx plugin. Try to update to 1.2.0 or newer version.

提交回复
热议问题