Android Proguard失败,并显示“值'i'不是参考值"; [英] Android Proguard failing with "Value 'i' is not a reference value"

查看:148
本文介绍了Android Proguard失败,并显示“值'i'不是参考值";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的应用程序(Gracenote的"GNSDK")中添加了一个库,现在正尝试使用Proguard构建要发布的应用程序.我曾经成功构建并安装了该应用程序的发行版,但随后的所有尝试均会产生此错误:

I recently added a library to my app ('GNSDK' by Gracenote) and am now trying to build the app for release using Proguard. I successfully built and installed the release version of the app once, but all subsequent attempts produce this error:

Unexpected error while evaluating instruction:
 Class       = [com/gracenote/gnsdk/GnManager]   
 Method      = [<init>(Landroid/content/Context;Ljava/lang/String;I)V]
 Instruction = [87] getfield #120
 Exception   = [java.lang.IllegalArgumentException] (Value "i" is not a 
  reference value [proguard.evaluation.value.UnknownIntegerValue])
  Unexpected error while performing partial evaluation:
    Class       = [com/gracenote/gnsdk/GnManager]
    Method      = [<init>(Landroid/content/Context;Ljava/lang/String;I)V]
    Exception   = [java.lang.IllegalArgumentException] (Value "i" is not a reference value [proguard.evaluation.value.UnknownIntegerValue])
  :app:proguardBetaRelease FAILED
  Error:Execution failed for task ':app:proguardBetaRelease'.

值"i"不是参考值[proguard.evaluation.value.UnknownIntegerValue]`

Value "i" is not a reference value [proguard.evaluation.value.UnknownIntegerValue]`

我试图通过以下方式迫使proguard单独保留该库(因为这是调试和发布版本之间的唯一区别):

I tried to force proguard to leave the library alone (since that's the only difference between the debug and release builds) with:

-keep class com.gracenote.** {
    *;
}

但似乎没有什么不同.

关于如何调试或跟踪此错误的任何提示?我不确定为什么com.gracenote.gnsdk.GnManager的构造函数会失败.该错误使它听起来像是收到了无效的 input .

Any hints on how to debug or track down this error? I am not sure why the constructor of com.gracenote.gnsdk.GnManager would be failing. The error makes it sound like it is getting an invalid input.

我正在使用Android Studio 1.4,构建工具23.0.0.

I'm using Android Studio 1.4, build tools 23.0.0.

推荐答案

我发现这是Proguard中的错误: https://sourceforge.net/p/proguard/bugs/573/

I found that this is a bug in Proguard: https://sourceforge.net/p/proguard/bugs/573/

看起来它将很快发布.同时,您可以通过添加以下内容来解决此问题:

Looks like it will be released soon. In the meantime, you can work around by adding:

-optimizations !class/unboxing/enum

到您的proguard文件.

to your proguard file.

这篇关于Android Proguard失败,并显示“值'i'不是参考值";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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