Android: Unable to build APK. More than one file was found with OS independent path 'META-INF/android.arch.lifecycle_runtime.version'

前端 未结 2 1241
Happy的楠姐
Happy的楠姐 2021-01-13 04:51

All of a sudden, I am getting this error while building APK

Error:Execution failed for task \':app:transformResourcesWithMergeJavaResForDevDebug\'.
> Mor         


        
2条回答
  •  孤城傲影
    2021-01-13 05:15

    In my case, I've excluded only path 'META-INF/LICENSE' on yourProject/app/build.gradle inside android{} . Here it is

    packagingOptions {
        exclude 'META-INF/LICENSE'
    }
    

    After it Clean Project and Rebuild Project.

    If above case doesn't work for you then You can add this in yourProject/app/build.gradle inside android{}

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
    

提交回复
热议问题