1

默认情况下,ACRA 只填充两个字段,基本上是内存转储和堆栈跟踪。我试图让 ACRA 返回 APP_VERSION、ANDROID_VERSION、PHONE_MODEL 等字段,但在最新版本的 ACRA 中,我没有找到 ReportField。* 以下是文档中显示的内容,但它没有为我编译。

 import static ReportField.*;   
 @ReportsCrashes(formKey = "xxxxxxxxxxxxxxxx", 
        customReportContent = { APP_VERSION, ANDROID_VERSION, PHONE_MODEL, CUSTOM_DATA,   STACK_TRACE, LOGCAT },                
        mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.crash_toast_text 
 public class MyApplication extends Application {
4

2 回答 2

1

org.acra.ReportField 确实存在于 acra jar 文件中。但是在 Android 4.0 中,JDK 1.6

该行:

导入静态 ReportField.*;不编译。

它应该是:

 import static org.acra.ReportField.*; 
于 2012-06-25T19:09:46.113 回答
0

Thats all fields from acra version 4.4.0 BUT REMEMBER!! 90% from erros on confg acra are on google docs form

Try this:

import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.annotation.ReportsCrashes;

import android.app.Application;
import android.content.Context;

@ReportsCrashes(formKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", customReportContent = {ReportField.APP_VERSION_CODE, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA,
        ReportField.STACK_TRACE, ReportField.LOGCAT, ReportField.AVAILABLE_MEM_SIZE, ReportField.REPORT_ID, ReportField.APPLICATION_LOG, ReportField.PACKAGE_NAME, ReportField.FILE_PATH,
        ReportField.BUILD, ReportField.BRAND, ReportField.PRODUCT, ReportField.TOTAL_MEM_SIZE, ReportField.INITIAL_CONFIGURATION, ReportField.CRASH_CONFIGURATION, ReportField.DISPLAY,
        ReportField.USER_COMMENT, ReportField.USER_APP_START_DATE, ReportField.USER_CRASH_DATE, ReportField.DUMPSYS_MEMINFO, ReportField.EVENTSLOG, ReportField.RADIOLOG, ReportField.IS_SILENT,
        ReportField.DEVICE_ID, ReportField.INSTALLATION_ID, ReportField.DEVICE_FEATURES, ReportField.ENVIRONMENT, ReportField.SETTINGS_SYSTEM, ReportField.SETTINGS_SECURE,
        ReportField.SHARED_PREFERENCES, ReportField.MEDIA_CODEC_LIST, ReportField.THREAD_DETAILS})
public class XYZApplication extends Application {
    public void onCreate() {
        ACRA.init(this);
        super.onCreate();
    }
}
于 2013-01-12T18:15:00.633 回答