2012-06-25 46 views
1

默認情況下,ACRA僅填充兩個字段,基本上是內存轉儲和堆棧跟蹤。 我想讓ACRA返回像APP_VERSION,ANDROID_VERSION,PHONE_MODEL這樣的字段,但是在ACRA的最新版本中,我找不到ReportField。*以下是文檔中顯示的內容,但不是爲我編譯。ACRA報告字段 - 不能添加更多的報告字段

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 { 

回答

1

org.acra.ReportField確實存在於acra jar文件中。然而,在Android 4.0的,JDK 1.6

行:

進口靜態ReportField *;不編譯。

它應該是:

import static org.acra.ReportField.*; 
0

這就是所有從ACRA版本4.4.0 字段,但切記! 90%從CONFG ACRA誤差修改是在谷歌文檔形式

試試這個:

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(); 
    } 
}