Cannot resolve method 'formKey' in ACRA 4.7.0

℡╲_俬逩灬. 提交于 2019-12-22 09:49:58

问题


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 = "mail@adress.com", mode = ReportingInteractionMode.NOTIFICATION)
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ACRA.init(this.getApplication());

I get the error Cannot resolve method 'formKey', but when deleting formkey from parameters, i get @ReportsCrashes not applicable to method

I also tried

@ReportsCrashes(formUri = "http://www.yourselectedbackend.com/reportpath")

and

@ReportsCrashes(formKey = "", formUri = "http://www.yourselectedbackend.com/reportpath")

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.


回答1:


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.

You are getting @ReportsCrashes not applicable to method because you have annotated your onCreate method. You need to annotate your Application class



来源:https://stackoverflow.com/questions/34157752/cannot-resolve-method-formkey-in-acra-4-7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!