问题描述
我今天尝试为我的Android项目设置acra,但它没有工作。我按照说明,在gradle中导入acra lib(编译'ch.acra:acra:4.7.0')
然后我添加了这个:
i tried setting up acra for my android project today, but it didnt work. I followed the instructions, importet the acra lib in gradle (compile 'ch.acra:acra:4.7.0')Then i added this:
@ReportsCrashes(formKey = "", mailTo = "[email protected]", mode = ReportingInteractionMode.NOTIFICATION)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ACRA.init(this.getApplication());
我收到错误无法解析方法'formKey',但删除form参数,我得到 @ReportsCrashes不适用于方法
I get the error Cannot resolve method 'formKey', but when deleting formkey from parameters, i get @ReportsCrashes not applicable to method
我也尝试过
@ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath")
和
@ReportsCrashes(formKey = "", formUri = "http://www.yourselectedbackend.com/reportpath")
并得到相同的错误。任何人都知道问题/解决方案? 上的wiki似乎过时了,有没有问题。
and get the same errors. Anyone knows the issue/solution? The wiki at https://github.com/ACRA/acra/wiki seems outdated and there is no issue about this.
推荐答案
formKey
已被删除一段时间。我不知道你在哪里看到使用它的指示,但是它们不再存在。使用 formUri
。
formKey
has been removed for some time. I don't know where you saw instructions to use it, but they should no longer exist too. Use formUri
.
您正在获得 @ReportsCrashes不适用于方法
因为您已经注释了您的 onCreate 方法
。您需要注释您的应用程序 class
You are getting @ReportsCrashes not applicable to method
because you have annotated your onCreate method
. You need to annotate your Application class
这篇关于在ACRA 4.7.0中无法解析方法'formKey'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!