【问题标题】:Proguard android library project with -dontobfuscate使用 -dontobfuscate 的 Proguard android 库项目
【发布时间】:2015-03-20 18:09:14
【问题描述】:

我正在我的 Android 库项目上运行 Proguard 并处理通行证。问题是当我将 .jar 插入具体应用程序并运行 gradle build 时,我得到:

> EXCEPTION FROM SIMULATION: local variable type mismatch: attempt to
> set or access a value of type java.lang.Class using a local variable
> of type java.util.Map$Entry[]. This is symptomatic of .class
> transformation tools that ignore local variable information. ...at
> bytecode offset 000000ff locals[0000]:
> Lio/netty/bootstrap/ServerBootstrap; locals[0001]: Ljava/lang/Object;
> locals[0002]: Lio/netty/channel/ChannelPipeline; locals[0003]:
> Lio/netty/channel/EventLoopGroup; locals[0004]:
> Lio/netty/channel/ChannelHandler; locals[0005]: [Ljava/util/Map$Entry;
> locals[0006]: Ljava/util/Map; ...while working on block 00ff ...while
> working on method init:(Lio/netty/channel/Channel;)V ...while
> processing init (Lio/netty/channel/Channel;)V ...while processing
> io/netty/bootstrap/ServerBootstrap.class 1 error; aborting
> 
> :app:preDexHiddenRelease FAILED

当我设置 proguard 规则时问题开始了:

-dontobfuscate
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*

【问题讨论】:

    标签: android proguard


    【解决方案1】:

    好的,谢谢: https://speakerdeck.com/chalup/proguard 虽然得到不一样的错误,但我意识到我必须为 proguard 设置额外的标志;

    -优化!代码/分配/变量

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-09
      • 2013-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-31
      • 2015-05-30
      • 1970-01-01
      相关资源
      最近更新 更多