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

前端 未结 2 1242
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'
    }
    
    0 讨论(0)
  • 2021-01-13 05:29

    You can try using pickFirst something like this:

    packagingOptions {
       // this is the lazy option.
       //pickFirst  'META-INF/*'
       pickFirst   'META-INF/android.arch.lifecycle_runtime.version'
    }
    
    0 讨论(0)
提交回复
热议问题