2012-11-21 170 views
2

我使用着名的ACRA錯誤報告工具將崩潰日誌發送到我在Google文檔中上傳的文檔。ACRA錯誤報告失敗

我按照所有低於

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

但是我的應用程序沒有錯誤報告發送到文件,其中我已經上傳提到的步驟。

我可以看到由ACRA生成的以下錯誤日誌。

2月1日至一日:11:19.995:E/ACRA(6054):ACRA抓住一個RuntimeException 例外com.example.arcasample。建設報告。

下面是我的源代碼,我相信它是完美的。

MyApplication.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); 
    } 

} 

的manifest.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> 

可發請告訴我,如果我錯過任何東西。

在此先感謝。

+0

你缺少塔ACAR活動聲明 <活動機器人:名字= 「org.acra.CrashReportDialog」 機器人:主題= 「@安卓風格/ Theme.Dialog」 機器人:launchMode = 「singleInstance」 機器人: excludeFromRecents =「true」 android:finishOnTaskLaunch =「true」/> – jnr

回答

0

好吧,我試着刪除在Google文檔上創建的表單並重新創建它。我不知道我以前做過什麼錯誤嗎?

反正重新創建窗體並仔細注意窗體關鍵解決了我的問題。