无法使用firebase生成已签名的APK

时间:2017-06-06 12:39:33

标签: android firebase firebase-realtime-database proguard android-proguard

因此,在将这两个Firebase库添加到我的项目之前,我能够生成签名的APK:

apply plugin: 'com.google.firebase.firebase-perf'


compile 'com.google.firebase:firebase-database:10.2.6'
compile 'com.google.firebase:firebase-perf:10.2.6'

这是我在尝试生成签名APK时遇到的错误:

Information:Gradle tasks [:app:assembleRelease]
Warning:com.google.firebase.appindexing.internal.zzd$zzb: can't find referenced method 'android.os.IInterface zzwW()' in program class com.google.firebase.appindexing.internal.zzc
Warning:com.google.firebase.appindexing.internal.zzf: can't find referenced method 'com.google.android.gms.tasks.Task doWrite(com.google.android.gms.internal.zzabn)' in program class com.google.firebase.appindexing.internal.zzf$zza
Warning:there were 2 unresolved references to program class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:java.lang.RuntimeException: Job failed, see logs for details
Error:java.io.IOException: Please correct the above warnings first.
Information:BUILD FAILED in 2m 50s
Information:2 errors
Information:4 warnings
Information:See complete output in console

感谢任何帮助,谢谢。

1 个答案:

答案 0 :(得分:0)

只需将这些行添加到您的proguard文件中即可。

-dontwarn com.google.firebase.appindexing.internal.**
-keep class com.google.firebase.appindexing.internal.** { *; }