2

我正在使用著名的 ACRA 错误报告工具将崩溃日志发送到我在 Google Doc 上上传的文档。

我已经按照下面提到的所有步骤

https://github.com/ACRA/acra/wiki/BasicSetup

但是我的应用程序仍然没有向我上传的文档发送错误报告。

我可以看到 ACRA 生成的以下错误日志。

01-01 02:11:19.995: E/ACRA(6054): ACRA 捕获了 com.example.arcasample 的 RuntimeException 异常。建设报告。

以下是我认为完美无缺的源代码。

我的应用程序.java

package com.example.arcasample;

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

import android.app.Application;

@ReportsCrashes(formKey = "XXXX")
public class MyApplication extends Application 
{

    @Override
    public void onCreate()
    {
        // ErrorReporter.getInstance().init(this); This is not helping me
        ACRA.init(this);
        super.onCreate();
    }

}

MainActivity.java

package com.example.arcasample;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends Activity 
{

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        int a = 10 / 0; <= This will cause crash.

        Log.i("vipul", "" + a);
    }

}

清单.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.arcasample"
    android:versionCode="1"
    android:versionName="1.0" >

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

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

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

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

</manifest>

如果我遗漏任何东西,有人可以告诉我。

提前致谢。

4

1 回答 1

0

好吧,我尝试删除在 Google 文档上创建的表单并重新创建它。我想知道我以前犯了什么错误?

无论如何,重新创建表单并仔细记下表单键解决了我的问题。

于 2012-11-21T09:52:53.647 回答