Google 开发者控制台显示我的应用程序在过去一个月中收到了两个相同的错误,但是这个RuntimeException
没有指定错误源自的类或文件。我看不出什么具体的东西。以下是两种不同设备的错误:
三星 Galaxy S8 Active (cruiserlteatt),4096MB RAM,Android 7.0
报告第 1 份(共 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)
三星 Galaxy S7 (heroqltespr),4096MB RAM,Android 7.0
报告第 2 份(共 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)
是什么导致了这个错误?这是唯一发生的两次,并且提供的日志不像我能够解决的其他错误那样显示 java 类或 xml 文件。
如果有人能帮助我解决这个问题,我将不胜感激,
非常感谢。
根据源代码 https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/ActivityThread.java,这里有两个地方ActivityThread.performLaunchActivity
where RuntimeException
被抛出。他们是:
} 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);
}
}
如你看到的:
- 他们都向
RuntimeException
其中包括来自原始异常的异常消息。
- 他们都通过了最初的异常(
e
)到RuntimeException
构造函数,以便它被正确链接。
如果没有因果异常消息(至少)和因果异常堆栈跟踪,或者没有完整的应用程序源代码,则几乎不可能诊断您的问题。
您需要弄清楚如何让 Google 开发者控制台为您提供缺失的信息,或者让 logcat 来记录它们。如果没有缺失的信息,我们无法为您提供帮助。
除此之外,我可以建议您,尝试诊断此类问题的最佳方法是查看 Android 源代码。 (这在这里不是很有帮助......但如果您缺少诊断信息,那就很有帮助了。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)