Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

classnotfound crashes not showing up in crashlytics, but in google play console

We are trying to debug a crash that happens for some users, but can't figure out exactly what it is.

In Google Play console, we see this:

java.lang.RuntimeException:  
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3331)
  at android.app.ActivityThread.-wrap20 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1734) 
  at android.os.Handler.dispatchMessage (Handler.java:102) 
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6688)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1468)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1358)
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.ActivityThread.handleReceiver (ActivityThread.java:3326)

We have Crashlytics set up in the project, and it is the first thing that loads when the app starts running. I suspect that perhaps one of the classes is missing from the manifest, but we looked at it (even disasemmbled the APK just to make sure) and they are all there.

We suspect that perhaps it is a class that one of the activities use during initialization, but some of them are 3rd party SDKs so we do not have access to their source.

Is there a way to see the class name that wasn't found? The errors don't show up on crashlytics and we are unable to reproduce it on any of the devices / emulators that we have.

Thanks!

Edit : Partial Resolution

The problem ended up being a notification package that we are using, that requires vendor-specific entries (which we do not have in our test devices) in the AndroidManifest.xml. After reintegrating almost all of our 3rd party services, we eventually saw the crash report disappear.

We were not able to achieve our general goal (get the exception text, not just the exception stack trace, from exceptions logged to Google Play Developer Console), so there is no "good" way (as far as we are aware) to find out which class was missing. Quite disappointing TBH.

like image 507
Noam Avatar asked Mar 18 '18 16:03

Noam


1 Answers

So not all users experience this exception. Clearly, at the run time, for those users, there is no such class known to the loader. My thought is that you are using a lib (like lib.so, either your own native code or a 3rd party lib) which its native code does not support a certain architecture (like MIPS, or Intel) and therefore such devices get the exception. Just something to investigate. There are emulators for different architectures so you might not even need real hardware to test if this is the root cause.

like image 95
Kaamel Avatar answered Oct 21 '22 11:10

Kaamel