从升级4.5 ACRA ACRA到4.6后编译错误 [英] Compilation error after upgrading from ACRA 4.5 to ACRA 4.6

查看:285
本文介绍了从升级4.5 ACRA ACRA到4.6后编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级从我的应用程序使用的ACRA库
4.5.0到4.6.0,但我得到了formKey编译错误
它采用4.5工作。

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.

下面是声明:

@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,
)

以下是错误:

错误:(19 17)错误:无法找到符号法formKey()

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

我试图消除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.

推荐答案

检查ACRA更新日志后,它似乎是ACRA的错误在4.6.0

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

PR#233 PR#235允许BuildConfig的位置是可配置的
  支持建立摇篮口味。 NB这是一个重大更改,如果你的
  正在捕获BuildConfig和你的应用程序类不驻留
  在你原来的Andr​​oidManifest定义的Java包
  表现:包属性。在这种情况下,您将需要
  在ACRA配置明确配置buildConfigClass。

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.

我刚刚升级的依赖条件4.6.2和错误不见了。
您还需要从注释声明删除formKey。

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,
)

这篇关于从升级4.5 ACRA ACRA到4.6后编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆