android - java Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug' -
i new android studio , use jackson in android-studio project. found 2 .jar files seems make looking ("jackson-core-asl-1.8.5" , "jackson-mapper-asl-1.8.5"). have included dependencies in app build.graddle :
compile 'org.codehaus.jackson:jackson-core-asl:1.8.5' compile 'org.codehaus.jackson:jackson-mapper-asl:1.8.5'
when build project works, when run on android vm build fail.
what went wrong: execution failed task ':app:transformresourceswithmergejavaresfordebug'. com.android.build.api.transform.transformexception: com.android.builder.packaging.duplicatefileexception: duplicate files copied in apk meta-inf/notice file1: c:\users\hal9000\androidstudioprojects\epiandroid\epiandroid\app\libs\jackson-core-asl-1.8.5.jar file2: c:\users\hal9000\androidstudioprojects\epiandroid\epiandroid\app\libs\jackson-mapper-asl-1.8.5.jar file3: c:\users\hal9000.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-core-asl\1.8.5\713a5564acb9a5467521bbb53221ab8e1fe65039\jackson-core-asl-1.8.5.jar file4: c:\users\hal9000.gradle\caches\modules-2\files-2.1\org.codehaus.jackson\jackson-mapper-asl\1.8.5\56439095aa051521c5abb330235820c66886b5e5\jackson-mapper-asl-1.8.5.jar
then tried add :
packagingoptions { exclude 'meta-inf/notice' }
in app build.graddle file doesn't work too.
thanks help.
i found solution removing 2 .jar in /libs, removing packagingoptions , write instead :
packagingoptions { exclude 'meta-inf/dependencies.txt' exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' exclude 'meta-inf/notice' exclude 'meta-inf/license' exclude 'meta-inf/dependencies' exclude 'meta-inf/notice.txt' exclude 'meta-inf/license.txt' exclude 'meta-inf/dependencies.txt' exclude 'meta-inf/lgpl2.1' }
and use dependencies instead:
compile ( [group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.4.1'], [group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.4.1'], [group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.4.1'] )
i hope in future.
Comments
Post a Comment