Native android app WebAuthProvider.init successful login but Credentials object all null values

I have an application that has been running for a couple of years, and the authentication code was written a few years before that,
so I know my auth0 library and code calls are really, really old, but … if it ain’t broke - don’t fix it

unfortunately Android is forcing me to upgrade from taget SDK minimum 34 to 35 (and google billing library 7)
ok so I made those changes (none of which at all affects the auth0 authentication i think)
and it wasn’t broke but now it is

under certain circumstances my successful logins are returning a credentials object on Success but every field is null instead of the
values from the login success

USING

implementation ‘com.auth0.android:auth0:1.8.0’

CALLING

WebAuthProvider.init(auth0)
.withScheme(scheme)
.withAudience(audience)
.withScope(“openid offline_access email”)
.withParameters(parameters) // “prompt”, “login”
.start((Activity)context, new AuthCallback() {

    ...

@Override
public void onSuccess(@NonNull Credentials credentials) {

funny thing is I have different build types in my build.gradle

the one for general running and debugging still works fine
the one to create a release to go to the Play Store is the broken one

the config for these build types is IDENTICAL with regard to the auth0 client, domain, audience, scheme, everything
yet one works as it did before (credentials comes loaded) and one comes back empty

the ONLY difference in the build types are these three lines for the type that is failing

     minifyEnabled true
     shrinkResources true
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

I am struggling to see how any of the changes I made or the three lines above could cause a difference in AUTH0 behavior like i am seeing ?

any ideas where to look next would be most welcome

Welcome back to the Auth0 Community!

I will need some time to investigate the issue and will provide further feedback ASAP!

Kind Regards,
Nik

Thanks Nik, I did file a support ticket and was advised to upgrade to V3 of the library that is the current support level, so I will investigate that to determine if it fixes the problem.

1 Like

Thank you for letting me know about that, looking forward to your update!

Kind Regards,
Nik

Hi again!

Sorry for the delayed reply to the topic. I can see that in the support ticket you have opened you have been advised to upgrade several environments which might be tied to the problem. I understand that this has not yet reached a conclusion, however, I am leaving this reply to provide further insight for whoever might have experienced the same issue. I will keep updating the topic with notes relevant from the respective support ticket.

Kind Regards,
Nik

Wanted to close the loop on this problem that I finally got around to resolving (I think) this month

As mentioned it seems there was unspecified Auth0 failures happening only when i built with minifyEnabled and shrinkResources flags in the buildtype
I ended up installing Android Studio on a new machine (but still working with an old version Giraffe compounding the obscelesense issue) and then slowly upgrade the code in steps,

  • 1st to use SDK 35 which was successful

  • then to use auth0 Android library 2.11.0
    after which i started to have the same sorts of problems where building without the two flags above worked OK and building with them produced errors

  • except they were not errors related to Auth0 as the new Auth0 library and some modified code all worked as expected with no problems once it got to run

  • the problem was the app was crashing on the first setContentView command for the mainActivity with AppCompat resource errors that were absolutely non-sensical
    given the app has been running successfully as constructed for 4+ years

  • to determine why, I commented out the two flags, ran ok, put back in the minify - worked ok, was about to try the other permutation but restored both flags to confirm the error still happened
    and presto - poof no more errors, no more app crashing Auth0 working exactly as expected, then and in every subsequent build with both flags on

so this was actually not an Auth0 error at all, but some “who knows what” quirk of the combination of builds with old versions of Android studio and different gradle versions and new dependency libraries
and modified code and “who knows what” other settings and versions and implementations and possibly cacheing of some sort that the whole house of cards is constructed upon (i did multiple clean projects before with no effect)

works now and i expect it to work once deployed to the app store and then downloaded from there so I will verify that and then try to get more up to date on the IDE and build tools and libraries etc etc