Skip to content

Sign out first then sign in causes android app crash. #68

Open
@GarlicDipping

Description

@GarlicDipping

From the sample code, it seems like when I sign out first, theConfiguration becomes null and when I sign in after, it stays null and causes app crash.

So I've wrapped and exposed GoogleSignIn_Configure method in GoogleSignInImpl class, and when configuration changes, call it and problem gone.

I took a quick look at native code and seems like it would cause not much problem(anyway it keeps calling CallConfigure() on every signin-out action), But I'd like to double check if It't ok to do.

Here's code for my modified Configuration accessor in GoogleSignIn.cs :

public static GoogleSignInConfiguration Configuration
{
    set
    {
        // Can set the configuration until the singleton is created.
        if (theInstance == null || theConfiguration == value || theConfiguration == null)
        {
            if(theInstance != null && theConfiguration == null)
            {
                //From sign out, Instance stays non-null but theConfiguration is null.
                //Needs configuration refresh.
                theInstance.impl.Configure(value);
            }
            theConfiguration = value;
        }
        else
        {
            throw new SignInException(GoogleSignInStatusCode.DeveloperError,
                "DefaultInstance already created. " +
                " Cannot change configuration after creation.");
        }
    }

    get
    {
        return theConfiguration;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions