android - ACRA 在 CrashReports.csv 文件中不显示任何内容

标签 android logcat acra

我已将 ACRA 集成到我的项目中并遵循 this步骤。

我正在使用 ACRA 4.4.0.jar。

根据说明,这是我的代码::

MyApplication类::

@ReportsCrashes(formKey="XXX-XXX-XXX") 

public class MyApplication extends Application
{
    @Override
    public void onCreate() 
    {
        ACRA.init(this);
        super.onCreate();
        // The following line triggers the initialization of ACRA
        System.out.println("~~~~~~~~~~ACRA Init Called");
    }
}

MainActivity.java

public class MainActivity extends Activity implements OnClickListener
{
    TextView txt_main;
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //txt_main=(TextView)findViewById(R.id.txtView);
        txt_main.setOnClickListener(this);
    }
    @Override
    public void onClick(View v)
    {
        switch (v.getId()) 
        {
        case R.id.txtView:
            Toast.makeText(this,"This is test",Toast.LENGTH_SHORT).show();

        default:
            break;
        }
    }
}

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.acar_demo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS" />

<application
    android:name=".MyApplication"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

现在,当我运行项目来测试 ACRA 时,我在 logcat 中得到以下内容::

 01-31 17:22:02.647: D/ACRA(18067): ACRA is enabled for com.example.acar_demo, intializing...
01-31 17:22:02.667: D/ACRA(18067): Using default Report Fields
01-31 17:22:02.667: D/ACRA(18067): Looking for error files in /data/data/com.example.acar_demo/files
01-31 17:22:02.667: I/System.out(18067): ~~~~~~~~~~ACRA Init Called
01-31 17:22:02.777: D/AndroidRuntime(18067): Shutting down VM
01-31 17:22:02.777: W/dalvikvm(18067): threadid=1: thread exiting with uncaught exception (group=0x40a7e228)
01-31 17:22:02.777: E/ACRA(18067): ACRA caught a RuntimeException exception for com.example.acar_demo. Building report.
01-31 17:22:02.897: W/Settings(18067): Setting data_roaming_allowed has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:02.897: W/Settings(18067): Setting data_roaming_blocked has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:02.897: W/Settings(18067): Setting data_roaming_guard_allowed has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:02.907: W/Settings(18067): Setting data_roaming_guard_blocked has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.388: W/Settings(18067): Setting sms_roaming_guard_allowed has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.408: W/Settings(18067): Setting voice_roaming_allowed has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.408: W/Settings(18067): Setting voice_roaming_blocked has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.418: W/Settings(18067): Setting voice_roaming_guard_allowed has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.418: W/Settings(18067): Setting voice_roaming_guard_blocked has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.438: W/Settings(18067): Setting vzw_global_roaming_options has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value.
01-31 17:22:03.588: I/ACRA(18067): READ_LOGS granted! ACRA can include LogCat and DropBox data.
01-31 17:22:03.598: D/ACRA(18067): Retrieving logcat output...
01-31 17:22:03.688: D/ACRA(18067): Writing crash report file 1359633123000.stacktrace.
01-31 17:22:03.728: D/ACRA(18067): About to start ReportSenderWorker from #handleException
01-31 17:22:03.728: D/ACRA(18067): Mark all pending reports as approved.
01-31 17:22:03.728: D/ACRA(18067): Looking for error files in /data/data/com.example.acar_demo/files
01-31 17:22:03.728: D/ACRA(18067): #checkAndSendReports - start
01-31 17:22:03.728: D/ACRA(18067): Looking for error files in /data/data/com.example.acar_demo/files
01-31 17:22:03.728: I/ACRA(18067): Sending file 1359633123000-approved.stacktrace
01-31 17:22:03.738: D/ACRA(18067): Waiting for Toast + worker...
01-31 17:22:03.798: D/ACRA(18067): Sending report 7bdf15b3-f216-459d-9ba8-a24592514742
01-31 17:22:03.798: D/ACRA(18067): Connect to https://docs.google.com/spreadsheet/formResponse?formkey=AAAAAA
01-31 17:22:03.868: D/dalvikvm(18067): GC_CONCURRENT freed 1457K, 34% free 3113K/4707K, paused 1ms+2ms
01-31 17:22:03.888: D/ACRA(18067): Sending request to https://docs.google.com/spreadsheet/formResponse?formkey=AAAAAA
01-31 17:22:03.898: I/global(18067): In close() at SocketHttpClientConnection
01-31 17:22:09.484: W/ResponseProcessCookies(18067): Invalid cookie header: "Set-Cookie: NID=67=bIAU_L4bnC06IFZrF4dN9nx2xvdfOQOb2CdfLBJk6T6Wgu0AfrXUor9DiioPcgVnw7e8yeS-lJHJ7Wj8r1SEz0iCczKR6B6VKYmoe9AeybcHaHs1xXStcsPv6SQ0KwfG;Domain=.google.com;Path=/;Expires=Fri, 02-Aug-2013 11:50:33 GMT;HttpOnly". Unable to parse expires attribute: Fri
01-31 17:22:09.494: D/ACRA(18067): #checkAndSendReports - finish
01-31 17:22:09.574: D/ACRA(18067): Wait for Toast + worker ended. Kill Application ? true
01-31 17:22:09.574: E/AndroidRuntime(18067): FATAL EXCEPTION: main
01-31 17:22:09.574: E/AndroidRuntime(18067): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.acar_demo/com.example.acar_demo.MainActivity}: java.lang.NullPointerException
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1262)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.os.Looper.loop(Looper.java:156)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread.main(ActivityThread.java:4987)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at java.lang.reflect.Method.invokeNative(Native Method)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at java.lang.reflect.Method.invoke(Method.java:511)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at dalvik.system.NativeStart.main(Native Method)
01-31 17:22:09.574: E/AndroidRuntime(18067): Caused by: java.lang.NullPointerException
01-31 17:22:09.574: E/AndroidRuntime(18067):    at com.example.acar_demo.MainActivity.onCreate(MainActivity.java:19)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.Activity.performCreate(Activity.java:4538)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
01-31 17:22:09.574: E/AndroidRuntime(18067):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
01-31 17:22:09.574: E/AndroidRuntime(18067):    ... 11 more

ACRA 说(在 Logcat 中)::发送报告 7bdf15b3-f216-459d-9ba8-a24592514742

检查此屏幕截图,特别是最后一行::

enter image description here

根据 logcat 的说法,Google 文档已成功收到该报告。

现在,每当我检查 CrashReport.csv 文件以检查(匹配)时,崩溃错误都会向我显示::

enter image description here

所以我错过了什么吗?

第二个问题如何查看单个崩溃条目?例如如果我的 Google 文档中有 5 个崩溃条目(考虑每个条目都是针对单独的崩溃错误),那么如何检查每个条目?
我认为 CrashReport.csv 包含有关以下内容的日志最后一个条目不是整个条目。如果我错了,请纠正我:)

任何帮助/建议将不胜感激:) 提前致谢...:)

最佳答案

经过多次尝试,终于成功并得到了我想要的。 最后我发现我犯了非常非常愚蠢的错误。

我该如何解决这个问题::

首先注意 CrashReports-Template.csv 中的文件。

现在,在创建页面时,您必须像这样添加此项目(我之前没有添加,我刚刚创建了空表单,这是我的错误)::

enter image description here

最后我得到了我想要的输出,如下所示::

enter image description here

这里已经记录了每个条目,我可以检查每个条目及其 logcat 和其他信息。

希望这对其他人有帮助:)

关于android - ACRA 在 CrashReports.csv 文件中不显示任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14625503/

相关文章:

Android - 未连接 Eclipse 时记录日志

Android Studio Gradle - 无法解析依赖项 : acra

Java - 通过MAC地址查找主机

android - Android map 中带有 Polygon 的自定义 TileProvider

android - ProGuard 无法删除 Log.i 函数调用

Android ACRA 未报告崩溃

android - 通过标签管理器在 Google Analytics v4 中的完整堆栈跟踪

android - 通过 Google Play Developer API 删除 Android 订阅列表

android - 在设置 onClickListener 之前检查 View 是否 == null

android - 在 logcat 中报告了哪些类型的泄漏,我们还有哪些其他方法或工具来查找泄漏?