您的位置:首页 > 移动开发 > Android开发

[Android]添加第三方jar后,使用ProGuard混淆打包出错的解决方法

2016-12-29 10:54 666 查看
在我的android应用中,加入了google广告推广的第三方库admob jar,但是在通过ProGuard混淆打包的时候找不到相关引用的类com.google.ads.internal.state.AdState 

jar文件的位置是在 /libs/GoogleAdMobAdsSdk-6.2.1.jar

 

LogCat error:
Proguard returned with error code 1. See console 

[/code]
Warning: 
com.google.ads.m: can't find referenced class
com.google.ads.internal.state.AdState
 
[/code]
Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState 

[/code]
You should check if you need to specify additional program jars. 

[/code]
Warning: there were 2 unresolved references to classes or interfaces. 

[/code]
You may need to specify additional library jars (using '-libraryjars'). 

[/code]
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
at proguard.ProGuard.execute(ProGuard.java:86)
at proguard.ProGuard.main(ProGuard.java:492)

[/code]

  只需要添加下面一句代码
-dontwarn com.google.ads.**

[/code]

到proguard-project.txt文件中,就可以成功的生成签名apk了! 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐