博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Proguard打包混淆报错:can't find superclass or interface
阅读量:6984 次
发布时间:2019-06-27

本文共 8916 字,大约阅读时间需要 29 分钟。

在Eclipse打包工程时报如下错误:

[2016-04-01 16:36:10 - bjjwcjgc] Proguard returned with error code 1. See console

[2016-04-01 16:36:10 - bjjwcjgc] Note: there were 4 duplicate class definitions.
[2016-04-01 16:36:10 - bjjwcjgc] (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.PermissionCacheOptimizer: can't find superclass or interface org.springframework.aop.framework.AopInfrastructureBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.PermissionEvaluator: can't find superclass or interface org.springframework.aop.framework.AopInfrastructureBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.SecurityMetadataSource: can't find superclass or interface org.springframework.aop.framework.AopInfrastructureBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.event.AbstractAuthorizationEvent: can't find superclass or interface org.springframework.context.ApplicationEvent
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.event.LoggerListener: can't find superclass or interface org.springframework.context.ApplicationListener
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.expression.AbstractSecurityExpressionHandler: can't find superclass or interface org.springframework.context.ApplicationContextAware
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.expression.SecurityExpressionHandler: can't find superclass or interface org.springframework.aop.framework.AopInfrastructureBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.expression.method.MethodSecurityEvaluationContext: can't find superclass or interface org.springframework.expression.spel.support.StandardEvaluationContext
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.AbstractSecurityInterceptor: can't find superclass or interface org.springframework.beans.factory.InitializingBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.AbstractSecurityInterceptor: can't find superclass or interface org.springframework.context.ApplicationEventPublisherAware
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.AbstractSecurityInterceptor: can't find superclass or interface org.springframework.context.MessageSourceAware
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.AfterInvocationProviderManager: can't find superclass or interface org.springframework.beans.factory.InitializingBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.MethodInvocationPrivilegeEvaluator: can't find superclass or interface org.springframework.beans.factory.InitializingBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.RunAsImplAuthenticationProvider: can't find superclass or interface org.springframework.beans.factory.InitializingBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.RunAsImplAuthenticationProvider: can't find superclass or interface org.springframework.context.MessageSourceAware
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.RunAsManagerImpl: can't find superclass or interface org.springframework.beans.factory.InitializingBean
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor: can't find superclass or interface org.aopalliance.intercept.MethodInterceptor
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor: can't find superclass or interface org.springframework.aop.support.AbstractPointcutAdvisor
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor: can't find superclass or interface org.springframework.beans.factory.BeanFactoryAware
[2016-04-01 16:36:10 - bjjwcjgc] Warning: org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor$MethodSecurityMetadataSourcePointcut: can't find superclass or interface org.springframework.aop.support.StaticMethodMatcherPointcut
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.ColorDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.GradientDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.InsetDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2016-04-01 16:36:10 - bjjwcjgc] Warning: there were 910 unresolved references to classes or interfaces.
[2016-04-01 16:36:10 - bjjwcjgc] You may need to add missing library jars or update their versions.
[2016-04-01 16:36:10 - bjjwcjgc] If your code works fine without the missing classes, you can suppress
[2016-04-01 16:36:10 - bjjwcjgc] the warnings with '-dontwarn' options.
[2016-04-01 16:36:10 - bjjwcjgc] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
[2016-04-01 16:36:10 - bjjwcjgc] Warning: there were 16 instances of library classes depending on program classes.
[2016-04-01 16:36:10 - bjjwcjgc] You must avoid such dependencies, since the program classes will
[2016-04-01 16:36:10 - bjjwcjgc] be processed, while the library classes will remain unchanged.
[2016-04-01 16:36:10 - bjjwcjgc] (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
[2016-04-01 16:36:10 - bjjwcjgc] Warning: there were 12 unresolved references to program class members.
[2016-04-01 16:36:10 - bjjwcjgc] Your input classes appear to be inconsistent.
[2016-04-01 16:36:10 - bjjwcjgc] You may need to recompile the code.
[2016-04-01 16:36:10 - bjjwcjgc] (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
[2016-04-01 16:36:10 - bjjwcjgc] java.io.IOException: Please correct the above warnings first.
[2016-04-01 16:36:10 - bjjwcjgc] at proguard.Initializer.execute(Initializer.java:473)
[2016-04-01 16:36:10 - bjjwcjgc] at proguard.ProGuard.initialize(ProGuard.java:222)
[2016-04-01 16:36:10 - bjjwcjgc] at proguard.ProGuard.execute(ProGuard.java:97)
[2016-04-01 16:36:10 - bjjwcjgc] at proguard.ProGuard.main(ProGuard.java:507)

大体意思是找不到相关的类或者方法,因为工程引入了第三方包,混淆的时候如果把第三方包也混淆了,那么相关的类在使用这些包的时候就会找不到相关方法。

因此在proguard-project.txt加上以下代码:

-dontwarn org.springframework.security.**-keep class org.springframework.security.** { *;}-dontwarn org.xmlpull.v1.**-keep class org.xmlpull.v1.** { *;}

其实找不到引用的这个类是第三方包里面的,而且很多时候我们只需要打乱自己的代码就行了,第三方包的代码就是否要打乱就不要管了。我们可以使用

-dontwarn com.xx.bbb.**

-keep class com.xx.bbb.** { *;}
参数来保持第三方库中的类而不乱,-dontwarn和-keep 结合使用,意思是保持com.xx.bbb.**这个包里面的所有类和所有方法而不混淆,接着还叫ProGuard不要警告找不到com.xx.bbb.**这个包里面的类的相关引用。
配置好后,重新打包,一切OK!而且程序能正确运行

转载于:https://www.cnblogs.com/chenlong-50954265/p/5345413.html

你可能感兴趣的文章
python使用snappy压缩
查看>>
Error: "Call requires API level 11 (current min is 8): android.app.Activity#onCreateView"
查看>>
Ubuntu12.04下Linux内核编译
查看>>
Codeforces Round #113 (Div. 2) Tetrahedron(滚动DP)
查看>>
结构体的使用
查看>>
NOR flash and NAND flash
查看>>
关于异步委托的调用与应用场景
查看>>
flask+redis实现抢购(秒杀)功能
查看>>
Linux 学习笔记 (一)在VMware 中安装 Ubtuntu 以及 VMware tools
查看>>
经典测试用例
查看>>
3月16日学习内容整理:metaclass
查看>>
Vue和其他框架的区别
查看>>
【iPhone5概念机最新效果图曝光】
查看>>
深入浅出:5G和HTTP
查看>>
ES6-let和const命令
查看>>
java反射,代码优化
查看>>
python中获取当前所有的logger
查看>>
关于BDD100k数据输入处理mask变为56*56
查看>>
Reveal使用心法
查看>>
Directx11教程(18) D3D11管线(7)
查看>>