2016-09-22 4 views
0

Я изменил minifyEnabled на true в файле build.gradle. Тогда я получил этот вопросAndroid Gradle Build Failed (Release Build type)

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. Пожалуйста, помогите мне с этим, чтобы сделать это

+0

http://stackoverflow.com/questions/33877134/errorexecution-failed-for-task-androidtransformclassesandresourceswithprogua –

+0

@jay проверить эту ссылку, возможно, это поможет [http://stackoverflow.com/questions/27547757/proguardrelease-failed -when-compiling-apk-with-assemblerelease-in-android-studio] –

+0

'Пожалуйста, исправьте вышеприведенные предупреждения в первую очередь.', что ваши предупреждения говорят вам? – nenick

ответ

0

При использовании Firebase аутентификации с compile 'com.google.firebase:firebase-auth:9.2.1' попробуйте добавить следующие флаги ваш proguard-rules.pro:

-keepattributes Signature 
-keepattributes *Annotation* 

Узнайте больше на Set up Firebase Authentication for Android.

Для База данных реального времени Firebase с compile 'com.google.firebase:firebase-database:9.2.1' вам необходимо подумать о том, как объекты модели будут сериализованы и десериализованы после обфускации. Подробности см. На странице Set up Firebase Realtime Database for Android.