问题
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