使用ProGuard

时间:2016-07-04 14:47:13

标签: android gradle android-proguard

我正在尝试使用Gradle 2.1.2将两个库(panframeindoo.rs)包含到我的Android项目中。两者都使用ProGuard可能会混淆他们的私人方法。由于两个lib都使用相同的混淆模式,因此onBind()中indoo.rs工作服务对静态方法的调用会导致ClassLoader的歧义:

  

java.lang.NoSuchMethodError:没有静态方法a(Ljava / lang / Object;)Ljava / lang / Object;在Lcom / a / a / a / g类;或其超级类('com.a.a.a.g'的声明出现在/data/data/com.companytest/files/instant-run/dex/slice-panframe-1.9_e8c65b231b25083f170d9dc622b9f9f514e9ecef-classes.dex)                                                                                  在com.a.a.h.a.j $ a。(SourceFile:449)                                                                                  在com.a.a.h.a.j.a(SourceFile:411)                                                                                  在com.customlbs.service.Worker.onBind(SourceFile:184)                                                                                  在android.app.ActivityThread.handleBindService(ActivityThread.java:3834)                                                                                  在android.app.ActivityThread.access $ 2200(ActivityThread.java:221)                                                                                  在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1887)                                                                                  在android.os.Handler.dispatchMessage(Handler.java:102)                                                                                  在android.os.Looper.loop(Looper.java:158)                                                                                  在android.app.ActivityThread.main(ActivityThread.java:7225)                                                                                  at java.lang.reflect.Method.invoke(Native Method)                                                                                  在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1230)                                                                                  在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

除了不在indoo.rs库中混淆com.a.a.h.a.j.a之外,还有什么方法可以防止这种情况发生吗?

0 个答案:

没有答案