以信譽F43nd1r,解決的辦法是把logcat的你ReportsCrashes註釋,例如
@ReportsCrashes (
mailTo = "[email protected]",
mode = ReportingInteractionMode.TOAST,
customReportContent = {ReportField.ANDROID_VERSION,
ReportField.STACK_TRACE,
ReportField.LOGCAT},
resToastText = R.string.crash_toast_text
)
原帖
我嘗試ACRA並希望它來捕捉堆棧跟蹤和logcat的。目前,我已配置它調用我的電子郵件應用程序發送數據。發生崩潰時,它會顯示敬酒信息,並在消息正文中打開具有堆棧跟蹤的電子郵件應用程序。但是,沒有logcat。
盡我所知,根據文檔,當我將READ_LOGS權限放入清單中時,它應該在報告中包含最後200行logcat。
我正在測試Android 7.0設備。
清單:
<manifest package="com.perinote.crashtest"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_LOGS"></uses-permission>
<application
...
</application>
</manifest>
包com.perinote.crashtest;
import ...;
@ReportsCrashes (
mailTo = "[email protected]",
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text
)
public class AppSubclass extends Application
{
@Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext(base);
ACRA.init (this);
}
}
我不認爲我的任何其他文件是相關的,但讓我知道如果你需要更多的信息。
** Nitpick **:不使用READ_LOGS。你必須有系統簽名才能使用它 – Zoe