4

I upgraded the ACRA library used by my application from 4.5.0 to 4.6.0 but I am getting a compilation error for formKey which used to work with 4.5.

Here is the declaration:

@ReportsCrashes(
  formKey = "",
  formUri = "",
  socketTimeout = 10000,
  httpMethod = org.acra.sender.HttpSender.Method.POST,
  mode = ReportingInteractionMode.SILENT,
  resDialogText = R.string.crash_dialog_text,
  resDialogIcon = android.R.drawable.ic_dialog_info,
  resDialogTitle = R.string.crash_dialog_title,
  resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
)

Here is the error:

Error:(19, 17) error: cannot find symbol method formKey()

I tried removing the formKey, as it is not used anymore, from the declaration but it's producing a new error after I did that.

Christian Abella
  • 5,747
  • 2
  • 30
  • 42
  • 1
    `formKey` has been deprecated for about 2 years and was removed in ACRA-4.6.0. That explains that compilation error. Provide some details of the other error you were getting. – William May 11 '15 at 03:38

1 Answers1

7

After checking the ACRA ChangeLog , it seems to be bug of ACRA in 4.6.0

PR#233 PR#235 Allowing the location of BuildConfig to be configurable to support Gradle build flavours. NB This is a breaking change IF your are capturing BuildConfig AND your Application class does not reside in the Java package defined in your original AndroidManifest manifest:package attribute. In that scenario you will need to explicitly configure 'buildConfigClass' in your ACRA config.

I just upgraded the dependecies to 4.6.2 and the error was gone. You also need to remove the formKey from the annotation declaration.

dependencies {
  compile 'ch.acra:acra:4.6.2'
}


@ReportsCrashes(
  formUri = "",
  socketTimeout = 10000,
  httpMethod = org.acra.sender.HttpSender.Method.POST,
  mode = ReportingInteractionMode.SILENT,
  resDialogText = R.string.crash_dialog_text,
  resDialogIcon = android.R.drawable.ic_dialog_info,
  resDialogTitle = R.string.crash_dialog_title,
  resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
)
Christian Abella
  • 5,747
  • 2
  • 30
  • 42