Platform Exception when trying to signup

138 views Asked by At

I am trying to sign up a user using a simple code where I have hardcoded the email and password as well. the code looks as following:

Future<String> _Signup(BuildContext context) async { 
    try { 
        await Amplify.Auth.signUp( 
            username: '[email protected]', 
            password: 'john12345', 
            options: CognitoSignUpOptions( 
                userAttributes: {'email': '[email protected]'}
            )
        );
    } catch (e) { 
        return e.toString(); 
    } 
}

When I click it throws below error:

PlatformException (PlatformException(AuthException, Translating platform exception failed. Please take a look at https://github.com/aws-amplify/amplify-flutter/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't., {recoverySuggestion: See attached exception for more details., underlyingException: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(java.lang.String, java.lang.String, com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes, java.util.Map, java.util.Map, com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.SignUpHandler)' on a null object reference, message: Sign up failed}, null))
0

There are 0 answers