Ich habe ACRA 4.8.5 in meiner App implementiert und es ist initialisiert und aktiviert und alle, aber wenn ich einen Fehler habe, erstellt es keinen Bericht ... Die einzigen zwei verwandten ACRA-Logs ich haben, sind:ACRA erstellt keinen Bericht
I/ACRA: ACRA is enabled for com.mydomain.myapp, initializing...
und
E/ACRA: ACRA caught a RuntimeException for com.mydomain.myapp
ich diese
@ReportsCrashes(reportSenderFactoryClasses = {ACRASenderFactory.class})
und
in meiner Anwendung Klasse@Override
public void onCreate() {
super.onCreate();
ACRA.init(this);
}
Hier ist meine ACRASenderFactory Klasse
public class ACRASenderFactory implements ReportSenderFactory {
public ACRASenderFactory(){
Log.e("ACRA", "Create Sender Factory");
}
@NonNull
@Override
public ReportSender create(Context context, ACRAConfiguration acraConfiguration) {
Log.e("ACRA", "Return Report Sender");
return new ACRAReportSender();
}
}
und hier ist meine ACRAReportSender Klasse
public class ACRAReportSender implements ReportSender {
public ACRAReportSender(){
Log.e("ACRA", "Report Sender created");
}
@Override
public void send(Context context, CrashReportData crashReportData) throws ReportSenderException {
Log.e("ACRA", "Trying to send crash report");
String reportBody = createCrashReport(crashReportData);
// Send body using email
Intent emailIntent = new Intent(Intent.ACTION_SEND);
// Set type to "email"
emailIntent.setType("vnd.android.cursor.dir/email");
String to[] = {"[email protected]"};
emailIntent.putExtra(Intent.EXTRA_EMAIL, to);
// Text
emailIntent.putExtra(Intent.EXTRA_TEXT, reportBody);
// Set the subject
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "ACRA Crash Report");
context.startActivity(Intent.createChooser(emailIntent, "Send crash to developpers by email ..."));
}
private String createCrashReport(CrashReportData crashReportData){
StringBuilder body = new StringBuilder();
body.append("Device : " + crashReportData.getProperty(ReportField.BRAND) + " - " + crashReportData.getProperty(ReportField.PHONE_MODEL))
.append("\n")
.append("Android Version : " + crashReportData.getProperty(ReportField.ANDROID_VERSION))
.append("\n")
.append("App Version : " + crashReportData.getProperty(ReportField.APP_VERSION_CODE))
.append("\n")
.append("STACK TRACE : \n" + crashReportData.getProperty(ReportField.STACK_TRACE));
return body.toString();
}
}
Ich weiß nicht wirklich, warum es nicht funktioniert .. Ich habe auch Internet in erlaubt mein Manifest und setze meinen App-Namen.
Jede Hilfe würde wirklich geschätzt werden! Danke!