Firebaseui-android: Class not found when unmarshalling: com.firebase.ui.auth.ui.FlowParameters

Created on 5 May 2017  路  11Comments  路  Source: firebase/FirebaseUI-Android

Step 2: Describe your environment

  • Android device: Samsung Grand Prime
  • Android OS version: 5.1.1
  • Google Play Services version: 10.2.98
  • Firebase/Play Services SDK version: 9.6.1
  • FirebaseUI version: 0.6.1

Step 3: Describe the problem:

Steps to reproduce:

  1. Try to sign with Google provider
  2. Then pick up your Google Account

Observed Results:

We have to scenarios: get the app from play store or run from AndroidStudio.
The problem is when you try to login with the version that I get from Google Play Store.
If you install from Android Studio or sending/installing apk to the device there is no problem, it works.

  • After pick up your gmail account the emerged windows gone and you come back to the FirebaseUI when offer how to sign ing (Google Sign In button)

Logcat:
05-05 05:43:28.241 3074-3263/? E/Parcel: Class not found when unmarshalling: com.firebase.ui.auth.ui.FlowParameters
java.lang.ClassNotFoundException: com.firebase.ui.auth.ui.FlowParameters
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at java.lang.Class.forName(Class.java:273)
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at android.os.Parcel.readValue(Parcel.java:2152)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at android.content.Intent.getStringExtra(Intent.java:5224)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1490)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1073)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4438)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4337)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:144)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2898)
at android.os.Binder.execTransact(Binder.java:461)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.firebase.ui.auth.ui.FlowParameters" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)聽
at java.lang.Class.forName(Class.java:309)聽
at java.lang.Class.forName(Class.java:273)聽
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)聽
at android.os.Parcel.readParcelable(Parcel.java:2245)聽
at android.os.Parcel.readValue(Parcel.java:2152)聽
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)聽
at android.os.BaseBundle.unparcel(BaseBundle.java:221)聽
at android.os.BaseBundle.getString(BaseBundle.java:918)聽
at android.content.Intent.getStringExtra(Intent.java:5224)聽
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1490)聽
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1073)聽
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4438)聽
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4337)聽
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:144)聽
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2898)聽
at android.os.Binder.execTransact(Binder.java:461)聽
Suppressed: java.lang.ClassNotFoundException: com.firebase.ui.auth.ui.FlowParameters
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 18 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Expected Results:

  • After log in, user information are shown.

Relevant Code:

mFirebaseAuth = FirebaseAuth.getInstance();

    //el listener de Firebase para la autenticacion
    mAuthStateListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            user = firebaseAuth.getCurrentUser();
            if (user != null) {
                // User is signed in
                onSignedInInitialize(user.getDisplayName());
            } else {
                // User is signed out
                onSignedOutCleanup();
                startActivityForResult(
                        AuthUI.getInstance()
                                .createSignInIntentBuilder()
                                .setIsSmartLockEnabled(false)
                                .setProviders(
                                        AuthUI.GOOGLE_PROVIDER)
                                .build(),
                        RC_SIGN_IN);
            }
        }
    };

@Override
protected void onResume() {
    super.onResume();
    mFirebaseAuth.addAuthStateListener(mAuthStateListener);
}

@Override
protected void onPause() {
    super.onPause();
    //Baja el listener como buena practica
    if (mAuthStateListener != null) {
        mFirebaseAuth.removeAuthStateListener(mAuthStateListener);
    }
    //mMessageAdapter.clear();
    //detachDatabaseReadListener();
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == RC_SIGN_IN) {
        if (resultCode == RESULT_OK) {
            // Sign-in succeeded, set up the UI
            Toast.makeText(this, "Signed in!", Toast.LENGTH_SHORT).show();
        } else if (resultCode == RESULT_CANCELED) {
            // Sign in was canceled by the user, finish the activity
            Toast.makeText(this, "Sign in canceled with ", Toast.LENGTH_SHORT).show();
            finish();
        }
    } 
}

//Como el usuario esta logueado trae el nombre para
private void onSignedInInitialize(String username) {

    mUsername = username;
    //set UI with username data
    Log.v(TAG,"onSignedIn");
    mTextViewUsername.setText(username);
    ingresarUsuario(user);
    //attachDatabaseReadListener();
}

private void onSignedOutCleanup() {
    mUsername = ANONYMOUS;
   // mMessageAdapter.clear();
   // detachDatabaseReadListener();
}

Most helpful comment

@tinoper I think you are right, since we are now pretty sure this is a ProGuard debugging issue I think this should be moved to StackOverflow. When you move it, post a link to the question here. Thanks!

All 11 comments

@tinoper ouch! v0.6.1 is insanely old, please upgrade to FirebaseUI v1.2.0. I'm guessing it has something to do with proguard, but you should update first before trying to figure it out.

Oh and you'll need to update play services to v10.2.0 馃槂

Yep I also think this has to do with proguard because you say it only occurs "with the version that I get from Google Play Store." The main difference between that version and your testing version is minifyEnabled true.

Can you:

  1. Update your dependencies.
  2. Clear data in the app.
  3. Show us your proguard configuration?

@SUPERCILEX thanks for your reply. As you suggest, I updated firebase-auth and FirebaseUI. So I have 'com.google.firebase:firebase-auth:10.2.0' and 'com.firebaseui:firebase-ui-auth:1.2.0' and added url 'https://maven.fabric.io/public' too.
Besides that the problem still continue, you're right about I have to update it.

I changed some relevant code in the listening and onActivityResult but still I can't successfully login. The user selector shows up, then I select my google account and after "loading" it came back to user selector again.
Moreover, it works ok in the emulator. So I checked the SHA1 but it is added to the project.
I'll search some response error but if you have any idea do not hesitate to write it down.

mAuthStateListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
user = firebaseAuth.getCurrentUser();
if (user != null) {
// User is signed in
onSignedInInitialize(user.getDisplayName());
} else {
// User is signed out
onSignedOutCleanup();
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()))
.build(),
RC_SIGN_IN);
}
}
};

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
// Get identity provider response from intent
IdpResponse response = IdpResponse.fromResultIntent(data);
if (resultCode == ResultCodes.OK) {
// Sign-in succeeded, set up the UI
Toast.makeText(this, "Signed in!", Toast.LENGTH_SHORT).show();
return;
} else {
Toast.makeText(this, "Sign in canceled with ", Toast.LENGTH_SHORT).show();
return;
}
}

05-06 13:04:26.279 3074-3448/? E/Parcel: Class not found when unmarshalling: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
java.lang.ClassNotFoundException: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at java.lang.Class.forName(Class.java:273)
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)
at android.os.Parcel.readParcelable(Parcel.java:2245)
at android.os.Parcel.readValue(Parcel.java:2152)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at android.content.Intent.getStringExtra(Intent.java:5224)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1490)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1073)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4438)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4337)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:144)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2898)
at android.os.Binder.execTransact(Binder.java:461)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.signin.internal.SignInConfiguration" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)聽
at java.lang.Class.forName(Class.java:309)聽
at java.lang.Class.forName(Class.java:273)聽
at android.os.Parcel.readParcelableCreator(Parcel.java:2281)聽
at android.os.Parcel.readParcelable(Parcel.java:2245)聽
at android.os.Parcel.readValue(Parcel.java:2152)聽
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)聽
at android.os.BaseBundle.unparcel(BaseBundle.java:221)聽
at android.os.BaseBundle.getString(BaseBundle.java:918)聽
at android.content.Intent.getStringExtra(Intent.java:5224)聽
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1490)聽
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1073)聽
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4438)聽
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4337)聽
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:144)聽
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2898)聽
at android.os.Binder.execTransact(Binder.java:461)聽
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 18 more

com.google.android.gms.auth.api.signin.internal.SignInConfiguration

That's not a FirebaseUI class so this is definitely a proguard issue... Could you share your build.gradle file with your release config? And the proguard rules would be helpful too. It should look something like this:

release {
    shrinkResources true
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    signingConfig signingConfigs.release
}

PS: Try using backticks to format code: ``` :smile:

@SUPERCILEX and @samtstern thanks again. You're right about it's not a firebase-ui class. I see that I didn't setup signingConfig signingConfigs.release

buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
}

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/tinoper/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-keepattributes Signature
-keepattributes *Annotation*

Maybe this is offtopic right now and I have to close and move this question to stackoverflow.

@tinoper did it work?

@SUPERCILEX Nop, I still I can't successfully login with signed apk. I published other apps without this issue but this will be the first one with Firebase and FirebaseUI.

@tinoper I think you are right, since we are now pretty sure this is a ProGuard debugging issue I think this should be moved to StackOverflow. When you move it, post a link to the question here. Thanks!

I have the same issue, and I do not have proguard enabled. Now any clue guys ?

I have also the same issue, and i update SHA1 key in my firebase Project and its Working.

Was this page helpful?
0 / 5 - 0 ratings