0
我正在使用最新的ACRA庫從實際的Android設備獲取崩潰報告。然而,當應用程序崩潰ACRA Toast確實顯示,我不能得到崩潰報告。ACRA應用程序崩潰庫不捕獲設備異常
這裏是我的MainApplication.java:
package com.mydomain.myapp;
import android.app.Application;
import android.content.res.Configuration;
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
@ReportsCrashes(formUri = "http://example.com/debug.php", mailTo = "[email protected]", //formUri ="http://yourserver.com/yourscript",
customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT },
mode = ReportingInteractionMode.TOAST,
//mode = ReportingInteractionMode.SILENT //,
resToastText = R.string.crash_toast_text) //, logcatArguments = { "-t", "100", "-v", "long", "ActivityManager:I", "MyApp:D", "*:S" }
public class MyMapApp extends Application {
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
public void onCreate() {
ACRA.init(this); //switching this did not work with super.onCreate()
super.onCreate();
// The following line triggers the initialization of ACRA
}
@Override
public void onLowMemory() {
super.onLowMemory();
}
@Override
public void onTerminate() {
super.onTerminate();
}
}
AndroidMainfest.xml
<application
android:name=".MyMapApp"
...
<service
android:name="org.acra.sender.SenderService"
android:exported="false"
android:process=":acra" />
的build.gradle:
dependencies {
compile 'ch.acra:acra:4.6.2'
}
我已經在設備上設置電子郵件帳戶。這怎麼能趕上應用程序崩潰?
正如在Github上指出的那樣,您沒有使用最新版本的ACRA(目前是4.8.2),並且您使用的不是ACRA-4.6.2的配置(如SenderService) 。您還可以指定formUri和MailTo。 – William