1

We are trying to migrate our project to other architecture.

We are met with the following error message:

Error:duplicate files during packaging of APK >/Users/xavi/Programming/wdandroid/project/build/outputs/apk/project-debug-unaligned.apk

Path in archive: lib/armeabi/libshinobicharts-android.so

Origin 1: >/Users/xavi/Programming/wdandroid/project/build/intermediates/exploded-aar/wdandroid/shinobichartsandroidlibrary/unspecified/jni/armeabi/libshinobicharts-android.so

Origin 2: >/Users/xavi/Programming/wdandroid/project/src/main/jniLibs/armeabi/libshinobicharts-android.so

You can ignore those files in your build.gradle:

android {

 packagingOptions {

   exclude ‘lib/armeabi/libshinobicharts-android.so’

 }

}

Duplicate files copied in APK lib/armeabi/libshinobicharts-android.so

File 1: >/Users/xavi/Programming/wdandroid/project/build/intermediates/exploded-aar/wdandroid/shinobichartsandroidlibrary/unspecified/jni/armeabi/libshinobicharts-android.so

File 2: >/Users/xavi/Programming/wdandroid/project/build/intermediates/exploded-aar/wdandroid/shinobichartsandroidlibrary/unspecified/jni/armeabi/libshinobicharts-android.so

Information:BUILD FAILED

I tried some solutions but It dosen`t work:

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'
    exclude 'META-INF/rxjava.properties'
    exclude 'lib/armeabi/libshinobicharts-android.so'
}

Trying to exclude the package as suggested (even though that seems like a bad idea) doesn’t resolve the error message.

We’ve been debugging this afternoon but can’t seem to make any progress. Any advice or help would be greatly appreciated!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Xavi Jimenez
  • 314
  • 1
  • 3
  • 16

2 Answers2

1

Who is Adam? Likely you're building the native assembly from source and also adding it as libshinobicharts-android.so. Simply delete that file and the assembly should still be linked.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
1

There are some problem New versions of the android studio: Try these steps:

  1. You have to build a new project(no alternate is available)

  2. Copy and paste your code from the previous project to new projects!

  3. Just try to build .apk after pasting some code So, You confirm that there is no error!

for the future just make some copies of your project like when 5% completed,10% completed, etc

Megamind Core
  • 114
  • 11