【问题标题】:Build error when use Google Analytics and odfuscation使用 Google Analytics 和 odfuscation 时生成错误
【发布时间】:2018-08-05 08:32:46
【问题描述】:

我在 android 上遇到这个错误:

任务“:app:transformClassesWithAndroidGradleClassShrinkerForDebug”执行失败。

ProGuard 配置解析器错误:C:\Users\user.gradle\caches\transforms-1\files-1.1\play-services-base-11.8.0.aar\6c960bd35f12660f\proguard.txt 行 3:88 不可行替代输入''

使用minifyEnabled trueshrinkResources true 时会出现这种情况

我尝试在 proguard-rules 中保留相同的文件,但它不起作用

-keep public class com.google.android.gms.* { public *; }

-dontwarn com.google.android.gms.**

-libraryjars /libs/libGoogleAnalytics.jar

-keep class com.google.android.apps.analytics.**{ *; }

谢谢!!

【问题讨论】:

    标签: android google-analytics google-play-services analytics proguard


    【解决方案1】:

    你必须add configuration to turn on ProGuard。这样做至少会奏效。

    buildTypes {
            release {
                debuggable false
                minifyEnabled true
                useProguard true
                ...
            }
            debug {
                debuggable true
                minifyEnabled true
                useProguard true
                ...
            }
        }
    

    【讨论】:

      猜你喜欢
      • 2015-09-28
      • 2020-05-10
      • 1970-01-01
      • 2013-09-06
      • 1970-01-01
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多