android – proguard不会忽略引用的库

前端之家收集整理的这篇文章主要介绍了android – proguard不会忽略引用的库前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用proguard,在proguard-project.txt中,我有一行忽略引用的类

-dontwarn com.google.ads.**

日志说:

Warning: com.flurry.android.ab: can’t find referenced class com.google.ads.InterstitialAd@H_403_8@ Warning: com.flurry.android.ab: can’t find referenced class com.google.ads.InterstitialAd@H_403_8@ Warning: com.flurry.android.ab: can’t find referenced class com.google.ads.InterstitialAd@H_403_8@ Warning: com.flurry.android.ab: can’t find referenced class com.google.ads.AdRequest@H_403_8@ Warning: com.flurry.android.ab: can’t find referenced class com.google.ads.AdRequest

……….

You should check if you need to specify additional program jars.@H_403_8@ Warning: there were 277 unresolved references to classes or@H_403_8@ interfaces. You may need to@H_403_8@ specify additional library jars (using ‘-libraryjars’). java.io.IOException: Please correct the above@H_403_8@ warnings first. at@H_403_8@ proguard.Initializer.execute(Initializer.java:321) at@H_403_8@ proguard.ProGuard.initialize(ProGuard.java:211) at proguard.ProGuard.execute(ProGuard.java:86)@H_403_8@ at proguard.ProGuard.main(ProGuard.java:492)

我将line -libraryjars ./libs/FlurryAgent.jar包含在congig文件中.我的问题是什么?

解决方法

正如您所尝试的那样,您应该将这一行放在proguard-project.txt中:
-dontwarn com.google.ads.**

您必须确保ProGuard实际使用此配置文件,并在project.properties中使用此行:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

这是Android SDK r20或更高版本的标准行(旧版本仅使用proguard.config = proguard.cfg,在这种情况下,您必须指定整个配置,而不是依赖SDK中的配置).

猜你在找的Android相关文章