我开始使用 ACRA ( https://github.com/ACRA/acra ) 进行崩溃报告。测试时,一切都很完美。尽管如此,当我发布该应用程序时,我在 Google Play 控制台中看到了一个错误,该错误是我发布的版本的新错误,原因是ACRA.init(this);:java.lang.RuntimeException: at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6209)at android.app.ActivityThread.access$1200 (ActivityThread.java:236)at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1784)at android.os.Handler.dispatchMessage (Handler.java:106)at android.os.Looper.loop (Looper.java:214)at android.app.ActivityThread.main (ActivityThread.java:7032)at java.lang.reflect.Method.invoke (Native Method)at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)Caused by: java.lang.IllegalStateException: at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1666)at android.app.ContextImpl.startService (ContextImpl.java:1611)at android.content.ContextWrapper.startService (ContextWrapper.java:677)at org.acra.sender.SenderServiceStarter.startService (SenderServiceStarter.java:43)at org.acra.util.ApplicationStartupProcessor.sendApprovedReports (ApplicationStartupProcessor.java:75)at org.acra.ACRA.init (ACRA.java:230)at org.acra.ACRA.init (ACRA.java:156)at org.acra.ACRA.init (ACRA.java:139)at com.myapplication.MyApplication.onCreate (MyApplication.java:132)at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1154)at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6204)的内容MyApplication.java:132是:ACRA.init(this);具有讽刺意味的是,这意味着初始化 ACRA 导致了崩溃。为了提供一些上下文,这是我的位置ACRA.init(this):@Overridepublic void onCreate() { // TODO Auto-generated method stub super.onCreate(); ACRA.init(this);
1 回答
慕运维8079593
TA贡献1876条经验 获得超5个赞
我的解决方案是使用这个:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
ACRA.init(this, new ConfigurationBuilder(this).build(), false);
MultiDex.install(this);
}
在日志中,我可以看到LOGCAT显示这一行:
08-18 16:31:50.489 I/ACRA (11890): ACRA is enabled for com.myapp, initializing...
现在初始化成功。
添加回答
举报
0/150
提交
取消