Android Gradle Build失败(发布版本类型)

时间:2016-09-22 05:25:10

标签: android android-studio build.gradle proguard

我在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存在一些问题。请帮助我完成这项工作

1 个答案:

答案 0 :(得分:0)

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