1

デフォルトでは、ACRA は基本的にメモリ ダンプとスタック トレースの 2 つのフィールドのみを設定します。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

これは acra バージョン 4.4.0 のすべてのフィールドですが、覚えておいてください!! confg acra のエラーの 90% は google docs フォームにあります

これを試して:

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 に答える