3

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.

lleo
  • 155
  • 1
  • 9

1 Answers1

5

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

William
  • 20,150
  • 8
  • 49
  • 91
  • 1
    The instructions are still there: On the [home page](http://www.acra.ch/): "The formKey parameter was used for the now deprecated GoogleDocs Forms backend. It is still required but not used anymore." and in the [Wiki](https://github.com/ACRA/acra/wiki/AdvancedUsage). – user905686 Dec 09 '15 at 14:43
  • OK, I'll get those references removed. Thanks. – William Dec 09 '15 at 21:52
  • This helped me Thanks.. I faced this issue when i updated acra , before to this , i was using it as jar. – Shainu Thomas Nov 21 '17 at 09:32