-
Notifications
You must be signed in to change notification settings - Fork 238
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
Fatal error when trying to upload image to s3 bucket #87
Comments
@mattRiddoch can you confirm that value.path is indeed a valid file path before passing it to the uploadFile() API? |
@Ashish-Nanda Here is what the path looks like: |
Hi @mattRiddoch I think the issue is likely coming from the Could you try using the |
The path of the file you provided seems fine, so not sure why you are getting the error. I also tried a clean setup today in an attempt to reproduce your issue and can confirm upload is working as expected. We are using the Let us know if you still face issues. |
OK! I brought in the
Upon picking an asset I get the following error: On a side note this is the exact same error I raise when I save a file to the documents folder and attempt to upload from there as well? |
Hi @mattRiddoch it's strange the example code isn't working for you now as well. We've validated this code works so this issue could be related to your configuration. Have you tried running the Amplify CLI to create a s3 bucket and performed an upload. Can you provide details on how you've generated your amplifyconfiguration.dart file? |
@mattRiddoch can you share you amplifyconfiguration.dart file? |
Sure thing @Ashish-Nanda
|
I am having an issue identical to this one - I am configured using the example Storage application and upon uploading I also get |
@Shrey29ansh I will give this a try soon. I have gotten a little sidetracked with other features but this is still very much an issue for me. Much appreciated. |
Hey @mattRiddoch have you been able to resolve this issue? |
I also got this error.
Now I have solved this error. The reason was that the list "plugins" in the StorageCategory class was empty. The problem is probably in the initial configuration of the plugins. Here is the code before the fix. // Add Pinpoint and Cognito Plugins
AmplifyAnalyticsPinpoint analyticsPlugin = AmplifyAnalyticsPinpoint();
AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
amplifyInstance.addPlugin(authPlugins: [authPlugin]);
amplifyInstance.addPlugin(analyticsPlugins: [analyticsPlugin]);
AmplifyDataStore datastorePlugin =
AmplifyDataStore(modelProvider: ModelProvider.instance);
amplifyInstance.addPlugin(dataStorePlugins: [datastorePlugin]);
// Add this line, to include the Auth plugin.
AmplifyStorageS3 storage = AmplifyStorageS3();
amplifyInstance.addPlugin(
authPlugins: [authPlugin],
storagePlugins: [storage]
);
// Once Plugins are added, configure Amplify
await amplifyInstance.configure(amplifyconfig); Here is the code after the fix. // Add Pinpoint and Cognito Plugins
AmplifyAnalyticsPinpoint analyticsPlugin = AmplifyAnalyticsPinpoint();
AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
AmplifyDataStore datastorePlugin =
AmplifyDataStore(modelProvider: ModelProvider.instance);
// Add this line, to include the Auth plugin.
AmplifyStorageS3 storage = AmplifyStorageS3();
amplifyInstance.addPlugin(
authPlugins: [authPlugin],
analyticsPlugins: [analyticsPlugin],
dataStorePlugins: [datastorePlugin],
storagePlugins: [storage]
);
// Once Plugins are added, configure Amplify
await amplifyInstance.configure(amplifyconfig); |
Hey @mattRiddoch . Sorry for the late reply. I tested in iOS, and Android and I couldn't reproduce the issue Feel free to test using the latest build and let us know if you got any issues Thanks |
Hey @mattRiddoch I am closing this issue for now as I didn't hear from you and I couldn't reproduce as per my comment above. Regards |
Describe the bug
Unexpectedly found nil while implicitly unwrapping an Optional value: file..../ios/Pods/AmplifyPlugins/AmplifyPlugins/Storage/AWSS3StoragePlugin/AWSS3StoragePlugin+ClientBehavior.swift, line 157
passing the file from the imagepicker
upload snippet:
crashing swift snippet (crashes on storageService):
I have an authenticated user.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the file to upload.
Screenshots
If applicable, add screenshots to help explain your problem.
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):
The text was updated successfully, but these errors were encountered: