【问题标题】:Android setup ACRA to get application bugs and crashes doesnt workAndroid 设置 ACRA 以获取应用程序错误和崩溃不起作用
【发布时间】:2016-06-29 19:49:35
【问题描述】:

以下代码是我的简单设置 ACRA,用于获取崩溃和我的应用程序错误,但设置 acra 不发送任何报告

@ReportsCrashes(
        /*LOCALHOST*/
        formUri = "http://192.168.1.35/acra.php/acra.php",
        customReportContent = {ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT},
        mode = ReportingInteractionMode.DIALOG)

public class EpayApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ACRA.init(this);
    }
}

本地主机 php 文件:

<?php
    // Outputs all POST parameters to a text file. The file name is the date_time of the report reception
    $fileName = date('Y-m-d_H-i-s').'.txt';
    $file = fopen($fileName,'w') or die('Could not create report file: ' . $fileName);
    foreach($_POST as $key => $value) {
    $reportLine = $key." = ".$value."\n";
        fwrite($file, $reportLine) or die ('Could not write to report file ' . $reportLine);
    }
    fclose($file);
?>

输入http://192.168.1.35/acra.php/acra.php可以创建空文件,获取报告没有问题,我的acra版本是4.9.0

我的清单:

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

<application
    android:name=".AppApplication"

【问题讨论】:

    标签: android acra


    【解决方案1】:

    android:name 属性的值应与您创建的应用程序类名称相同。你的情况不同。

    改变这个

    android:name=".AppApplication"
    

    android:name=".EpayApplication"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-13
      • 1970-01-01
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多