Firebaseui-android: Version 3.3.0 breaks proguard again

Created on 29 Mar 2018  ยท  16Comments  ยท  Source: firebase/FirebaseUI-Android

I am seeing this in one of my projects when upgrading from 3.2.2 to 3.3.0

Warning: com.firebase.ui.auth.data.remote.TwitterSignInHandler$TwitterSessionResult: can't find referenced class retrofit2.Call
Warning: com.firebase.ui.auth.data.remote.TwitterSignInHandler$TwitterSessionResult: can't find referenced class retrofit2.Call

We added this to our proguard config:

-dontwarn com.firebase.ui.auth.provider.**

But then we killed the provider classes.

I suspect the workaround is:

-dontwarn com.firebase.ui.data.remote.**
auth fix-implemented bug

All 16 comments

Confirmed Workaround:

-dontwarn com.firebase.ui.auth.data.remote.**

@samtstern ๐Ÿคฆโ€โ™‚๏ธ Alright, that's it. I'm making a proguard test module. ๐Ÿ‘

At least you are not getting this:

Error in /Users/.../.gradle/caches/transforms-1/files-1.1/play-services-base-12.0.1.aar/d4cede01fde67af88a30dd3361237f85/proguard.txt:
  Expected field or method name at /Users/.../.gradle/caches/transforms-1/files-1.1/play-services-base-12.0.1.aar/d4cede01fde67af88a30dd3361237f85/proguard.txt:3:89
  com.google.android.gms.common.api.internal.BasePendingResult.ReleasableResultGuardian <fields>;

for a few weeks already. I submitted 74602137 on Issue Tracker, but someone at Google marked as private, I can't even see how my issue is going ๐Ÿ˜ž. Has anyone here found any workaround for it?

@bernaferrari huh that issue actually came across my desk internally and I asked "Bernardo could you show all of your app's dependencies?" but I did not realize it was private so you were not getting the responses.

So, could you show your build.gradle file? Maybe app and project level.

Also I notice you're using Android Studio 3.2 Canary 6, could you try this with either 3.0 or 3.1 stable?

@samtstern Sure. There was a project attached in that issue, I updated it here for 3.2 Canary 8.
fbui alpha08.zip
On 3.1 stable, I needed to put

compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

and, for some reason, it was ignoring the ProGuard file, so I needed to put the twitter dependency, but everything worked fine after it. On 3.2 Canary 8, nothing solved.

Ok @bernaferrari if this is only an issue in 3.2 Canary 8 I think that's something we should just wait on, canary versions of Android Studio tend to break the build in amazing ways. I really can only justify investigating this as a FirebaseUI issue if it's present in a stable or beta version of Android Studio (which it seems like it is not?)

Ok for now..

I'm on canary 8 right now and it works fine. I've disabled R8 though... Have you tried that?

@SUPERCILEX wow, worked, thanks.. ๐Ÿคฃ looks so simple now, r8 is the guilty.

Android studio version 3.0.1 stable channel
Added a proguard rule : -dontwarn com.firebase.ui.auth.provider.**
does nothing and still causes this issue

Can someone tell me what to do? I am not even using retrofit2 or twitter apis anywhere

Error:Note: there were 11 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning: com.firebase.ui.auth.data.remote.TwitterSignInHandler$TwitterSessionResult: can't find referenced class retrofit2.Call
Warning: com.firebase.ui.auth.data.remote.TwitterSignInHandler$TwitterSessionResult: can't find referenced class retrofit2.Call
Warning: there were 2 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
FAILURE: Build failed with an exception.

BUILD FAILED in 11s

@koolkvd see above
-dontwarn com.firebase.ui.auth.data.remote.**

yea trying it now and seems like it's working. Why is this happening, i want to understand... I mean did i do something wrong?

@koolkvd no this is our fault. We moved some classes to the auth.data.remote package but didn't update our consumer proguard rules (the ones we export).

We moved some classes to the auth.data.remote package but didn't update our consumer proguard rules (the ones we export).

@samtstern More for my curiosity than anything, but I've had this issue in my own app (where I move classes but forget to update proguard rules)... Are @Keep annotations not a way to solve this (i.e. keep the -keep statements out of rules and use annotations only)? Would this work in a library fashion as well, or no?

@btrautmann I guess we could write a custom annotation and add a proguard rule for it, but we aren't planning on touching those classes for months... Great idea to keep in mind if we mess up again! ๐Ÿ˜Š (Or if you want to make a PR, I don't think anyone would object. ๐Ÿ˜‰)

PS: what we're doing is different than the keep rule, we're just trying to tell proguard that it should ignore class not found warnings.

This has been fixed and released in 3.3.1

Was this page helpful?
0 / 5 - 0 ratings