agnostech / flutter_amplify

Flutter Plugins for AWS Amplify SDK
https://agnostech.github.io/flutteramplify
MIT License
78 stars 15 forks source link

Crash iOS when signUP with an existing email #11

Closed hugoallain closed 4 years ago

hugoallain commented 4 years ago

Hey!

I noticed a problem using your plugin. For information, I use Flutter's version 1.17.1.

When I use signUp with an already used email address, I have no problem on Android, just this error message in the console:

I/flutter (18967): PlatformException(Error, Error signing up, An account with the given email already exists. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UsernameExistsException; Request ID: d6078b21-d3f4-4e40-96f7-7e96f64843fc))

So it seems to do its job.

On the other hand, on iOS, the application crashes. Here is the error message:

2020-05-27 18:03:34.623080+0300 Runner[66028:25198067] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/username/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_aws_amplify_cognito-1.0.0+7/ios/Classes/SwiftFlutterAwsAmplifyCognito.swift, line 194

It looks like a plugin issue on the iOS side. Hope it will help you to fix it :)

orestesgaolin commented 4 years ago

Just to clarify because I have the same error. Plugin works on Android and crashes on iOS.

NassB commented 4 years ago

Yes same problem for me.

orestesgaolin commented 4 years ago

You can check out my fork, but it's still not perfect https://github.com/agnostech/flutter_amplify/pull/12

NassB commented 4 years ago

Okay, thanks. I hope they will check this issue ASAP because I need to release this app for my client before the end of the month.

I forgot to mention that the problem happens when I try to log in, call resendSignUp, and forgotPassword too.

Some screenshots with Xcode debug for the sign-in process.

Capture d’écran 2020-06-20 à 03 15 48 Capture d’écran 2020-06-20 à 03 14 33 Capture d’écran 2020-06-20 à 03 14 01
NassB commented 4 years ago

Okay so I resolved my problem by following those links after checking issues in the GitHub AWS SDK IOS :

The awsconfiguration.json file for iOS was in my ios/Runner folder. So I deleted it and drag and drop directly the file into Xcode after opening Runner.xcworkspace.

Capture d’écran 2020-06-20 à 15 41 29

And I am using @orestesgaolin fork with the 'update-dependencies' branch.

I hope this will help!

midhilaj-com-06 commented 4 years ago

You can check out my fork, but it's still not perfect #12

Please check this https://github.com/agnostech/flutter_amplify/issues/13