android– 外部Admob jar的Proguard运行时错误

android– 外部Admob jar的Proguard运行时错误,第1张

概述签名的应用程序给出错我的应用程序使用外部Admobjar,但是proguard正在触摸jar:jar文件位于/libs/GoogleAdMobAdsSdk-6.2.1.jar谢谢LogCat错误:Proguardreturnedwitherrorcode1.SeeconsoleWarning:com.google.ads.m:can'tfindreferencedclasscom.google.ads.in

签名的应用程序给出错

我的应用程序使用外部Admob jar,但是proguard正在触摸jar:

jar文件位于/libs/GoogleAdMobAdsSdk-6.2.1.jar

谢谢

LogCat错误:

Proguard returned with error code 1. See consoleWarning: com.Google.ads.m: can't find referenced class  com.Google.ads.internal.state.AdStateWarning: com.Google.ads.m: can't find referenced class com.Google.ads.internal.state.AdState  You should check if you need to specify additional program jars.Warning: there were 2 unresolved references to classes or interfaces.     You may need to specify additional library jars (using '-libraryjars').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)

这是在jar文件中

配置proguard-project.txt:

-libraryjars /libs/GoogleAdMobAdsSdk-6.2.1.jar-dontpreverify-repackageclasses ''-allowaccessmodification-optimizations !code/simplification/arithmetic-keepattributes *Annotation*-keep public class * extends androID.app.Activity-keep public class * extends androID.app.Application-keep public class * extends androID.app.Service-keep public class * extends androID.content.broadcastReceiver-keep public class * extends androID.content.ContentProvIDer-keep public class * extends androID.vIEw.VIEw {public <init>(androID.content.Context);public <init>(androID.content.Context, androID.util.AttributeSet);public <init>(androID.content.Context, androID.util.AttributeSet, int);public voID set*(...);}-keepclasseswithmembers class * {public <init>(androID.content.Context, androID.util.AttributeSet);}-keepclasseswithmembers class * {public <init>(androID.content.Context, androID.util.AttributeSet, int);}-keepclassmembers class * extends androID.content.Context {public voID *(androID.vIEw.VIEw);public voID *(androID.vIEw.MenuItem);}-keepclassmembers class * implements androID.os.Parcelable {static androID.os.Parcelable$Creator CREATOR;}-keepclassmembers class **.R$* {public static <fIElds>;}

添加后

-keep public class com.Google.ads.**

对于该文件,eclipse控制台仍然提供以下错误:

Proguard returned with error code 1. See consoleNote: there were 160 duplicate class deFinitions.Warning: com.Google.ads.m: can't find referenced class     com.Google.ads.internal.state.AdStateWarning: com.Google.ads.m: can't find referenced class    com.Google.ads.internal.state.AdStateYou should check if you need to specify additional program jars.Warning: there were 2 unresolved references to classes or interfaces.You may need to specify additional library jars (using '-libraryjars').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)

解决方法:

我刚加了

-dontwarn com.Google.ads.**

到proguard-project.txt文件和签名的apk工作正常!
这是推荐的(如之前Eric所说):Proguard can’t find referenced class com.google.ads.internal.state.AdState

总结

以上是内存溢出为你收集整理的android – 外部Admob jar的Proguard运行时错误全部内容,希望文章能够帮你解决android – 外部Admob jar的Proguard运行时错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1116563.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存