gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 16:00:25 27 4
gpt4 key购买 nike

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com