Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211 #88

Closed
danielvtan opened this issue Aug 27, 2020 · 3 comments

Comments

@danielvtan
Copy link

danielvtan commented Aug 27, 2020

Describe the bug
iOS app crash when logging in

Expected behavior
Should be able to login

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducable in (check all that apply):
[] Android
[X] iOS

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: iOS 13.3

Additional context
Add any other context about the problem here.

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file 
<project location>Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211

Same project run in android is working

dependencies:
...
  amplify_core: '<1.0.0'
  amplify_auth_cognito: '<1.0.0'
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "ap-southeast-1:---",
                            "Region": "ap-southeast-1"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "ap-southeast-1_---",
                        "AppClientId": "---",
                        "AppClientSecret": "---",
                        "Region": "ap-southeast-1"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                }
            }
        }
    }
}''';
@danielvtan danielvtan changed the title Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211 iOS: Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211 Aug 27, 2020
@danielvtan
Copy link
Author

Issue was. we had a third party flutter cognito plugin installed. removing it resolved the issue

@pal
Copy link

pal commented Sep 9, 2020

I get this same error in iOS and only have these deps:

dependencies:
  flutter:
    sdk: flutter

  amplify_core: '<1.0.0'
  amplify_auth_cognito: '<1.0.0'
  amplify_analytics_pinpoint: '<1.0.0'

  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

This is the stock todo-app, but with the addition of sign-in code:

SignInResult res = await Amplify.Auth.signIn(
  username: 'myusername',
  password: 'mysupersecurepassword',
);

Any ideas?

@danielvtan
Copy link
Author

Have you tried running

pub get
flutter clean
flutter run

this usually solve dependency issues if your pubspec is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants