21

The Google Developer Console shows that my app has received two of the same errors in the past month, but this RuntimeException doesn't specify a class or file for which the error stems from. There's nothing specific that I can see. Below are the error for two different devices:

Samsung Galaxy S8 Active (cruiserlteatt), 4096MB RAM, Android 7.0 Report 1 of 2

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2984)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3045)
  at android.app.ActivityThread.handleRelaunchActivity 
(ActivityThread.java:4978)
  at android.app.ActivityThread.-wrap21 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1648)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6781)
  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)

Samsung Galaxy S7 (heroqltespr), 4096MB RAM, Android 7.0 Report 2 of 2

java.lang.RuntimeException: 
  at android.app.ActivityThread.performLaunchActivity 
(ActivityThread.java:2947)
  at android.app.ActivityThread.handleLaunchActivity 
(ActivityThread.java:3008)
  at android.app.ActivityThread.handleRelaunchActivity 
(ActivityThread.java:4974)
  at android.app.ActivityThread.-wrap21 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1656)
  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)

What could it be causing this error? These are the only two times it happened, and the log provided doesn't show a java class or xml file like other errors I am able to resolve.

Would greatly appreciate it if someone could help me resolve this, many thanks.

user207421
  • 305,947
  • 44
  • 307
  • 483
4u53r
  • 717
  • 1
  • 7
  • 17
  • Mostly you will find another exception in the logs. Please dont omit that one. – greenapps Nov 11 '17 at 13:56
  • 2
    @greenapps Nothing at all has been omitted, I have provided everything and made that clear in my post. – 4u53r Nov 11 '17 at 20:10
  • 1
    'This `RuntimeException` doesn't specify a class or file for which the error stems from'. Yes it does. The class is `RuntimeException`, and the file is `ActivityThread.java`, and for good measure the line number is 2984. – user207421 Nov 12 '17 at 00:41
  • 8
    Did you ever resolve this issue? I see it sporadically for one of my apps as well. But I can't seem to reproduce the issue on my emulators or devices – bremen_matt Jan 15 '18 at 13:28
  • Hi @4u53r did you manage to solve this issues, or at least have any idea where the issues are coming? I have the same situation :| – Adelino Jul 03 '18 at 08:10
  • 1
    Google, save us all... – Starwave Sep 06 '18 at 09:24
  • 1
    Did you happen to find what the solution is? I'm seeing this error too... – coderpc Feb 12 '19 at 19:03
  • 1
    Did anyone solve it? Have the same problem and no clue what to do... – Red Jul 26 '19 at 15:30
  • To the people posting "me too" comments, nobody is going to help you unless you provide the missing information. See the *bolded* sentence in my answer. – Stephen C Aug 15 '19 at 06:45

1 Answers1

6

According to the source code, here are two places in ActivityThread.performLaunchActivity where RuntimeException is thrown. They are:

    } catch (Exception e) {
        if (!mInstrumentation.onException(activity, e)) {
            throw new RuntimeException(
                "Unable to instantiate activity " + component
                + ": " + e.toString(), e);
        }
    }

and

    } catch (Exception e) {
        if (!mInstrumentation.onException(activity, e)) {
            throw new RuntimeException(
                "Unable to start activity " + component
                + ": " + e.toString(), e);
        }
    }

As you can see:

  • They both provide a message for the RuntimeException that includes the exception message from the original exception.
  • They both pass the original exception (e) to the RuntimeException constructor so that it is properly chained.

Without the causal exception message (at least) and the causal exception stacktrace, OR your complete app source code, it is going to be next to impossible to diagnose your problem.

You need to figure out how to get the Google Developer Console to give you the missing info, or get logcat to log them. We can't help you without that missing info.

Apart from that, I can advise you that the best way to try to diagnose problems like this is to look at the Android source code. (It is not very helpful here ... but it would be if you had the missing diagnostic information.)

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216