aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.31k stars 247 forks source link

A value of type 'String?' can't be returned from a function with return type 'String' because 'String?' is nullable and 'String' isn't #5555

Open LakshithWithana opened 3 days ago

LakshithWithana commented 3 days ago

Description

These are the packages in the pubspec.yaml amplify_flutter: amplify_auth_cognito: amplify_authenticator: amplify_storage_s3: ^2.4.0 amplify_core: ^2.4.0

when running/debugging the app this error is given -

Launching lib/main_development.dart on iPhone 15 in debug mode... Xcode build done. 39.6s Failed to build iOS app Error (Xcode): ../../../../.pub-cache/hosted/pub.dev/amplify_core-2.4.1/lib/src/config/amplify_outputs/auth/auth_outputs.g.dart:16:61: Error: A value of type 'String?' can't be returned from a function with return type 'String' because 'String?' is nullable and 'String' isn't.

Could not build the application for the simulator. Error launching application on iPhone 15.

Exited (1).

Categories

Steps to Reproduce

Just run/debug app.

Screenshots

Screenshot 2024-10-15 at 14 10 46

Platforms

Flutter Version

3.24.3

Amplify Flutter Version

2.4.0

Deployment Method

Amplify Gen 2

Schema

No response

NikaHsn commented 3 days ago

@LakshithWithana sorry that you are facing this issue. would you please share your amplify_outputs.dart with any sensitive info removed.