【发布时间】: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/*
【问题讨论】: