android - ACRA 崩溃报告是否也需要服务许可?

标签 android acra

ACRA documentation集成崩溃报告包括 3 个简单的步骤:

1 - Install ACRA library

2 - 将以下内容添加到 AndroidManifest.xml

<!-- in the manifest, not the application tag -->
<uses-permission android:name="android.permission.INTERNET" />

<application ... android:name=".MyApplication">
    ...
</application>

3 - 创建一个与上面“MyApplication”同名的新 java 类:

import org.acra.*;
import org.acra.annotation.*;

@ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath")
public class MyApplication extends Application {
  @Override
  public void onCreate() {
    // The following line triggers the initialization of ACRA
    super.onCreate();
    ACRA.init(this);
  }
}

应该是这样的。我认为这些说明有点过时了,而且 AndroidManifest.xml 从那时起就发生了变化。

我也是needed在我的 <application> ... </application> 中添加以下内容让它发挥作用:

<service android:name="org.acra.sender.SenderService" />

问题:我是不是做错了什么,或者 Android 要求发生了变化而我做的是正确的?

无论哪种方式,我也想分享/记录我的步骤,以防其他人遇到同样的问题。

最佳答案

可以在 ACRA 的 GitHub Wiki 上找到更新的基本设置说明:https://github.com/ACRA/acra/wiki/BasicSetup

Declaring the SenderService

ACRA (4.8+) uses the SenderService to send reports so it needs to be configured in your AndroidManifest.

If you are using manifest merging then the SenderService will be automatically included for you. Otherwise you will also need to configure a service that will send the reports. It should look like:

    <service
        android:name="org.acra.sender.SenderService"
        android:exported="false"
        android:process=":acra" />

NB the android:process ensures that the service runs in the :acra process. The intent is that that process is different from the default process for your application to ensure that the reports can be sent even though your app will be in shutdown mode if it has crashed.

GitHub 站点上的最新更新可能尚未更新文档站点。

关于android - ACRA 崩溃报告是否也需要服务许可?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36013868/

相关文章:

android - RefreshableListView cannot be cast to ListView 错误(拉动刷新)

android - ACRA 未创建报告

android - ACRA 和 LeakCanary

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

android - Firebase Auth - GoogleAuthProvider 和 FacebookAuthProvider 正在取代 EmailAuthProvider

java - 选择音量 channel 以在按下音量键时更改

android - 仅支持 armeabi 和 x86 的 android 库的问题

android - 来自移动视觉 API 的 getIsLeftEyeOpen 概率给出 -1 的值

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

android - ACRA:没有互联网连接时会发生什么?