2

Guys my apk works on my own phone but I attached it to Google Play Store.I installed app from store but it doesn't work. When I check developer console I see this error. Please help me what can I do?

java.lang.RuntimeException: 
 at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2819) 
 at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988) 
 at android.app.ActivityThread.-wrap14 (ActivityThread.java) 
 at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631)
 at android.os.Handler.dispatchMessage (Handler.java:102) 
 at android.os.Looper.loop (Looper.java:154) at android.app.ActivityThread.main (ActivityThread.java:6682) 
 at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520) 
 at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)
Caused by: java.lang.ClassNotFoundException: 
 at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:56) 
 at java.lang.ClassLoader.loadClass (ClassLoader.java:380) 
 at java.lang.ClassLoader.loadClass (ClassLoader.java:312) at android.app.Instrumentation.newActivity (Instrumentation.java:1086) 
 at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2809)
hardillb
  • 54,545
  • 11
  • 67
  • 105
Uncle Soft
  • 41
  • 1
  • 3
  • Without knowing what class it can't find (which should be in the log output near this stacktrace) we don't really stand much chance of helping. Also please read the help on asking good questions: https://stackoverflow.com/help/how-to-ask – hardillb Aug 02 '17 at 14:16
  • Might be something to do with your Proguard / Minify configuration, try enabling Proguard / Minify on your debug build, build / install on device from Android Studio and see if you get the same problem. – Zippy Aug 20 '17 at 14:03
  • @Uncle Soft have you fixed this? I'm getting this exception in Google Play console, but I have no idea what could be causing it – kodlan Oct 31 '18 at 13:31

2 Answers2

0

add this to gradle.build:

defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...

// Enabling multidex support.
multiDexEnabled true
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

And android:name="android.support.multidex.MultiDexApplication"

to <application /> in AndroidManifest.xml

Source: https://developer.android.com/studio/build/multidex.html

Sam
  • 822
  • 2
  • 8
  • 30
0

Do the steps as mentioned by @Sameer, and follow it up with making sure that your Instant Run is off. As of the time I am writing this answer, Instant Run is still not perfect, especially when it comes to Multidexed files.

To switch off Instant Run,

(Mac Users)
>> Command + Comma (⌘ + ,)
>> "Build, Execution and Deployment" section
>> Instant Run
>> Disable the checkbox
>> (Window users, you may have to search, probably in the settings section)

Now Clean your project and run it.

BlueLeaf
  • 210
  • 3
  • 15