Crash Logged 'Java. Lang. Runtimeexception' That Only Happens in Android 8.1 (Api 27), Stack Trace Is Not Pointing to Our Code, How to Debug?

Recently our app have logged multiple crashes at Google Play Console, that happens with various devices but ONLY on those with android 8.1 (SDK 27).

Stack trace for this crash looked like this:

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3006)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3084)
  at android.app.ActivityThread.-wrap11 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1781)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:210)
  at android.app.ActivityThread.main (ActivityThread.java:7080)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:523)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:863)
  at .CPU
  at .26
  at .14
  at .13

How do use this limited info for tracing the root cause of the problem, since that none of the line referring to the code from the app? Is there any method to reproduce this? Emulator using SDK 27 didnt catch the errors.

Note: App in question is developed using Java on android studio

1 Answer

With your exception message, RuntimeException with Unknown Source occurs when the method can not be found by reflection.

In my experiences, this problem usually cause on third-party sdk, some method it called maybe was obsoleted on specified Android version or not support on specified device (such as Mi、Samsung .. etc).

Here are some advices for you, hope them helps.

  1. Check the crash reports to find out other common points (e.g. mobile manufacturer), it would be helpful.
  2. Try upgrade most of your dependencies to the latest version
  3. Try search this exception with your dependencies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest