0

我正在尝试使用 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 'com.inmobi.monetization:inmobi-ads:6.0.3'”。在使用 Inmobi 的 jar 文件之前。

当我使用 InMobi 旧版本 5.0.4 即 jar 文件时,那个时候 proguard 没有问题。

仅在使用 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>

仍然遇到问题

4

1 回答 1

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>,一切都会正确,项目将编译。

于 2016-11-18T09:36:31.490 回答