Android:InMobi新版本6.0.3的Proguard问题

时间:2016-11-18 08:41:20

标签: android android-proguard inmobi

我正在尝试使用proguard签名的APK。在为InMobi添加依赖项之前,它的工作正常。

我收到警告

         You may need to add missing library jars or update their versions.

Warning:there were 2 unresolved references to classes or interfaces.
     If your code works fine without the missing classes, you can suppress
     the warnings with '-dontwarn' options.

没有使用依赖项 “compile'c​​om.inmobi.monetization:inmobi-ads:6.0.3'”。在使用jar文件进行Inmobi之前。

当我使用InMobi旧版本5.0.4,即jar文件时,该时间程序没有问题。

仅在使用InMobi新版本6.0.3时才会出现问题

使用网站中提供的proguard规则

-keepattributes SourceFile,LineNumberTable
-keep class com.inmobi.** { *; }
-keep public class com.google.android.gms.**
-dontwarn com.google.android.gms.**
-dontwarn com.squareup.picasso.**
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
   public *;
 }
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
 public *;
 }

-keep class com.moat.** {*;}
-dontwarn com.moat.**<br>

仍然遇到问题

1 个答案:

答案 0 :(得分:1)

Proguard引发的真正错误是:

Warning:com.moat.analytics.mobile.inm.ay: can't find referenced class com.moat.analytics.mobile.inm.ay$com.moat.analytics.mobile.inm.bb

这意味着库.apk已被混淆,我们并不真正知道导致问题的类,但我们知道,com.moat.analytics.mobile.inm包导致了问题。

考虑到这一点并仔细调查Proguard内容会导致最后一行:

-dontwarn com.moat.**<br>

最后不应该有<br>。它导致此行具有不正确的语法,proguard只是忽略它。删除<br>,一切都正确,项目将编译。