0

I have a working Android app which runs well on mobile phones. I tried to run the app on my tablet.

I got this message -

Instant Run does not support deploying build variants with multidex enabled, 
to a target with API level 20 or below.To use Instant Run with a multidex 
enabled build variant, deploy to a target with API level 21 or higher.

and got this error during build

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
 com.android.build.api.transform.TransformException: java.util.zip.ZipException: 
 duplicate entry: android/support/v13/app/FragmentCompatICS.class

So, I connected my phone, Build and Run the app on my phone. It worked fine. I know that Android Studio generated apk file. So, I copied the apk file to my tablet and installed it but the app crashed with the dialog "Unfortunately stopped".

What is causing this crash and how do I solve it?

Curio
  • 1,331
  • 2
  • 14
  • 34
Thunder Kay
  • 143
  • 13
  • What version of Android is running on your tablet? Have you tried setting your target API to 21 or higher? – Amber Jun 05 '17 at 16:47
  • Tab runs 4.4.2 i.e API 19 – Thunder Kay Jun 05 '17 at 17:02
  • it doesn't crash on the rablet. It even doesn't get built. It doesn't relate to the tablet at all. it's all about your app sources (containing duplicate classes) – Vladyslav Matviienko Jun 05 '17 at 17:05
  • Can you elaborate? I dont think I have duplicate classes – Thunder Kay Jun 05 '17 at 17:08
  • Seems odd that you could build and run on your phone but not your tablet. If it really is a duplicate class you may need to delete any extra support jars - see [this post](https://stackoverflow.com/questions/30937525/java-util-zip-zipexception-duplicate-entry-android-support-v4-accessibilityser). You might also try bumping up your target API to the latest version. You can [read more about that here](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html). – Amber Jun 05 '17 at 19:59
  • Your tablet is running an older version of android than API 21 – OneCricketeer Jun 05 '17 at 20:55
  • @cricket_007 My minSdk is set to 16. So, it should run – Thunder Kay Jun 06 '17 at 04:56
  • It's the target sdk, as the error states – OneCricketeer Jun 06 '17 at 08:09

0 Answers0