Skip to content Skip to sidebar Skip to footer

On Gradle:3.0.0 More Than One File Was Found With Os Independent Path 'meta-inf/asl2.0'

I have updated my Android studio to 3.0 and then he asked to upgrade to 'com.android.tools.build:gradle:3.0.0' everything went well until i decided to run my project and it's givi

Solution 1:

You should add to application build.gradle your packagingOptions:

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

Solution 2:

Try this first before you try other methods.

first:

check if you have set this in you build.gradle->dependencies

implementationfileTree(include: ['*.jar'], dir: 'libs')

if you've set this in you build.gradle file then check for this too if you tried to import libraries from your libs directory:

implementation files('libs/...')

if you have this too in your build.gradle file, please remove it or comment it out, because you are trying to re-import the library again which result is that error.

Solution 3:

Simply adding below code solves the problem

packagingOptions {
    pickFirst  'META-INF/*'
}

Solution 4:

You can add to the packagingOptions block with in the android block in your application build.gradle,

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "abcd.efgh.com.x"
        minSdkVersion 22
        targetSdkVersion 29
        versionCode 29
        versionName "1.9.2"
    }
    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'
    }
}

Post a Comment for "On Gradle:3.0.0 More Than One File Was Found With Os Independent Path 'meta-inf/asl2.0'"