Reputation: 4679
After updating
compile 'com.firebaseui:firebase-ui-database:0.4.0'
to
compile 'com.firebaseui:firebase-ui-database:2.3.0'
I'm able to compile and run my app on my test device, but when attempting to generate the signed apk, I get this in 'messages gradle build'. I expect it's a proguard issue:
Information:Gradle tasks [:app:assembleRelease]
Warning:android.arch.lifecycle.Transformations: can't find referenced class android.arch.core.util.Function
Warning:android.arch.lifecycle.Transformations$1: can't find referenced class android.arch.core.util.Function
Warning:android.arch.lifecycle.Transformations$2: can't find referenced class android.arch.core.util.Function
Warning:there were 16 unresolved references to classes or interfaces.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
Information:BUILD FAILED in 11s
Information:1 error
Information:5 warnings
Information:See complete output in console
I've tried incremental version updating, but that hasn't worked either. For example:
compile 'com.firebaseui:firebase-ui-database:2.0.0'
won't even sync, giving a merge error message.
I also updated my other SDKs but the firebaseui line now triggers it. Here is a partial app gradle as was asked of me in the comments:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.google.android.gms:play-services-drive:11.4.0'
compile 'com.google.android.gms:play-services-plus:11.4.0'
compile 'com.google.android.gms:play-services-location:11.4.0'
compile 'com.google.android.gms:play-services-auth:11.4.0'
compile 'com.google.android.gms:play-services-wallet:11.4.0'
compile 'com.google.android.gms:play-services-games:11.4.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:support-v13:26.1.0'
compile 'com.google.firebase:firebase-core:11.4.0'
compile 'com.google.firebase:firebase-invites:11.4.0'
compile 'com.google.firebase:firebase-ads:11.4.0'
compile 'com.google.firebase:firebase-database:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
compile 'com.google.firebase:firebase-config:11.4.0'
compile 'com.google.firebase:firebase-messaging:11.4.0'
compile 'com.google.firebase:firebase-crash:11.4.0'
compile 'com.google.firebase:firebase-analytics:11.4.0'
compile 'com.google.firebase:firebase-appindexing:11.4.0'
compile 'com.firebaseui:firebase-ui-database:2.3.0'
}
Here are my proguard rules as also mentioned in the comments, with a couple added lines on the end I tried. I've experimented with various syntax without effect.
-renamesourcefileattribute SourceFile
-keepattributes Signature
-keepattributes SourceFile
-keepattributes LineNumberTable
-keepattributes *Annotation*
-keep class com.android.**
-keepclassmembers class com.android.**
Upvotes: 3
Views: 1279
Reputation: 138
I was getting this error too on 'com.firebaseui:firebase-ui-database:2.4.0'.
This add to the proguard worked for me. Just put it anywhere in your proguard rules:
-dontwarn android.arch.**
Upvotes: 1
Reputation: 4679
I found that the proguard reference in the error messages was a red herring. This after adding dozens of extra rules to my proguard-rules file to no avail. After adding an auth compile:
compile 'com.firebaseui:firebase-ui-database:2.3.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
I am able to build a signed apk (earlier in the process adding this line had caused errors so I abandoned it). Oddly, with
compile 'com.firebaseui:firebase-ui-database:0.4.0'
I hadn't needed the auth compile.
Also after adding the auth compile I had to change all my compile versions '26.1.0' to '26.0.1' in the app gradle to avoid merge errors, presumably with the new auth compile. This despite the 'newer version is available 26.1.0' suggestion it gives me for these compiles. The newest buildToolsVersion available I am using is:
buildToolsVersion "26.0.1"
Such are the hurdles overcome in android development through hard experience, regardless of java coding skill.
Upvotes: 2