0

thank you for your support. My issue is : When I added the multidex dependecy and try to export the signed apk, I get this error :

Error:Execution failed for task ':androidKeyboardThemes:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/ActivityRecognition$1.class

My gradle dependecies are theses:

 dependencies {
    compile project(':cropper')
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/StartAppInApp-2.4.7.jar')
    compile files('libs/google-play-services.jar')
    compile 'com.android.support:multidex:1.0.1'
}

I tried to delete one lib or jar at any time and build again but I couldn't get the job done. Also I read all the unswer about duplicated class in stackoverflow but I failed again to solve my issue. Any ideas?, thank you for your help.

Saurabh Bhandari
  • 2,438
  • 4
  • 26
  • 33
Seben
  • 11
  • 3

1 Answers1

1
dependencies {
compile project(':cropper')
compile 'com.google.android.gms:play-services:+'   <-- choose either one
compile files('libs/StartAppInApp-2.4.7.jar')
compile files('libs/google-play-services.jar')     <-- choose either one
compile 'com.android.support:multidex:1.0.1' 
}

Whatever it is, please dont use play-services. inside compile 'com.google.android.gms:play-services:+' contains alot of dependencies.. see below.. using play-services may cause dex problem and heavy app. refer here

Community
  • 1
  • 1
ZeroOne
  • 8,996
  • 4
  • 27
  • 45
  • thank you for your unswer; It works with this: **gradle:** `dependencies { compile project(':cropper') compile 'com.google.android.gms:play-services-plus:10.2.1' // All of them except pay, map and location compile 'com.google.android.gms:play-services-games:10.2.1' compile files('libs/StartAppInApp-2.4.7.jar') //compile files('libs/google-play-services.jar') compile 'com.android.support:multidex:1.0.1 }` But still when I tested the APK to install it on my device it took 85 s. Any the major problem is solved, thank you @Saurabh and @ZeroOne. – Seben May 13 '17 at 21:23