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.32k stars 247 forks source link

Error while configuring storage category #5335

Closed perrydev17 closed 2 weeks ago

perrydev17 commented 2 months ago

Description

hi, I am getting an error when trying to add the storage plugin into the flutter app, I confirm auth is working as expected, but storage is erroring out

amplify_flutter: ^2.0.0 amplify_auth_cognito: ^2.0.0 amplify_authenticator: ^2.0.0 amplify_storage_s3: ^2.0.0

this is the code in main.dart

flutter-error

in amplifyconfiguration.dart I have "storage":{ "aws_region":"us-east-1", "bucket_name":"xxx" <- the bucket was created during amplify gen2 setup },

and this is the error crashing the app

flutter-error2

thanks in advance!

Categories

Steps to Reproduce

app crash and can't be loaded upon the line addPlugin(storage), I have tried both method addPlugins and addPlugin

Screenshots

No response

Platforms

Flutter Version

3.4.1

Amplify Flutter Version

^2.0.0

Deployment Method

Amplify CLI

Schema

No response

Jordan-Nelson commented 2 months ago

@perrydev17 - It look like the stack trace is from a browser. Are you able to reproduce this on any other platform? If so, can your provide the stack trace from that platform?

perrydev17 commented 2 months ago

hi @Jordan-Nelson also not able to run in other platforms (Android)

amplify_secure_storage-0.5.4/android/src/main/kotlin/com/amazonaws/amplify/amplify_secure_storage/AmplifySecureStoragePlugin.kt: (49, 16): Class 'kotlin.Result' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

separately, I was able to run the debug mode (web) with no error, but got the error with flutter run

Jordan-Nelson commented 2 months ago

@perrydev17 Before running on Android you will need to follow the Android platform setup steps here: https://docs.amplify.aws/flutter/start/platform-setup/#android

I am not able to reproduce the error you are seeing on web. Can you provide the following info:

NikaHsn commented 2 weeks ago

I'm closing this issue as we did not hear back. Please feel free to open a new issue if the issue is not resolved.

github-actions[bot] commented 2 weeks ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.