【问题标题】:Android Gradle Build Failed (Release Build type)Android Gradle 构建失败(发布构建类型)
【发布时间】:2017-01-30 13:09:59
【问题描述】:

我已在 build.gradle 文件中将 minifyEnabled 更改为 true。然后我得到了问题

 Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
    :app:transformClassesAndResourcesWithProguardForRelease FAILED
    Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
    > java.io.IOException: Please correct the above warnings first.

依赖项

compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/YouTubeAndroidPlayerApi.jar')
debugCompile project(path: ':djlibrary')
releaseCompile project(path: ':djlibrary')
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'

proguard 存在一些问题。请帮助我完成它

【问题讨论】:

标签: android android-studio build.gradle proguard


【解决方案1】:

当使用 Firebase 身份验证compile 'com.google.firebase:firebase-auth:9.2.1' 时,请尝试将以下标志添加到您的 proguard-rules.pro:

-keepattributes Signature
-keepattributes *Annotation*

Set up Firebase Authentication for Android了解更多信息。

对于带有compile 'com.google.firebase:firebase-database:9.2.1'Firebase 实时数据库,您需要考虑在混淆后如何对模型对象进行序列化和反序列化。有关详细信息,请在Set up Firebase Realtime Database for Android 阅读更多内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-16
    • 2016-01-20
    • 1970-01-01
    • 2013-06-13
    • 2015-02-06
    • 1970-01-01
    相关资源
    最近更新 更多