Android : Apache POI duplicate entry: org/apache/xmlbeans/xml/stream/Location.class error

前端 未结 5 1624
庸人自扰
庸人自扰 2020-12-12 02:29

Hi I am getting following error while running my android project :

Error:Execution failed for task \':app:transformClassesWithJarMergingForDebug\'.
> com.         


        
5条回答
  •  渐次进展
    2020-12-12 02:56

    In your Gradle Compile with support:multidex and add also dexOptions

    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    
    
    
    defaultConfig {
       ..............
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    
    
    }
    dexOptions {
        //incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }
    
    packagingOptions {
        exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
        exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
     }
    
     dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    //Your Dependencies
    compile 'com.android.support:multidex:1.0.1'
     }
    

    In Your AndroidManifest.xml add this lines android:name

    
    

    If you have using the play service library than replace with

     compile 'com.google.android.gms:play-services:+'
    

    Instead OF

       compile 'com.google.android.gms:play-services-maps:8.4.0' //or other
    

提交回复
热议问题