-
Notifications
You must be signed in to change notification settings - Fork 259
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
Amplify.isConfigured returns false on hot restart #1658
Comments
This started to happen after updating Amplify-Flutter from 0.4.2 into 5.0 and from 2.8 flutter to 3.0.1 |
Hi, were you able to reproduce it ? |
Hello @amizer12 - I will take a look at this today and attempt to reproduce it. |
I can confirm that it has been happening to me during hot restarts too. Any idea when it can be resolved? |
yeah but that is not ideal ;) |
Not a lot of workarounds are :) |
Hey everyone - Sorry for the delay in an update. I was able to confirm the behavior you are experiencing. This is because I think there are a couple options for resolving this. Unfortunately neither of them are great options:
As I mentioned above, this issue exists because Amplify-Flutter depends on the native Amplify-iOS and Amplify-Android plugins, and we are working on migrating away from these native libraries. As mentioned by @amizer12, unchecking "All Exceptions" will make it so that you do not see the exceptions. This is personally how I typically have my IDE configured (even when working on non-amplify projects) since seeing caught exceptions can be pretty noisy, but I definitely understand that there are times where you want to break on all exceptions. I will mark this as a bug. |
Hello --any updates on this issue? I am still getting this exception on hot restart. Thanks. |
This issue has been addressed in v1.0.0 of Amplify Flutter, which is now stable. This release also includes web and desktop support for Auth, API, Analytics, and Storage. You can see the list of new features and bug fixes in the release notes, and see more details on how to migrate in the upgrade guide. |
Experiencing the issue, isConfigured returns false.
Code:
|
I have reopened the issue as I believe this will still be an issue for DataStore. In v1 all plugins have been rewritten in Dart with the exception of DataStore. |
Hi, any updates on this issue? I still have a problem with hot restart. |
Me also having this issue. So If catch exception as already configured, I run other tasks related Amplify normally, weird things is catching another error, that AmplifyAnalyticsPinpoint is not configured, although add all them together at the first run.
|
Hi @harrynguyen2510 so you're getting an AmpliyfyAnalyticsPinpoint is not configured exception when catching AlreadyConfiguredExceptions and performing a hot restart? |
Hey, any update on this? Still getting this issue with DataStore. |
it is still same issue. @fjnoyp Not only AmpliyfyAnalyticsPinpoint, whole Amplify service return false although it was configured before. |
@fjnoyp this could do with being fixed soon.. sometimes, the completer within the amplify configure does not return in time before the next check configured is set to true, and we get other exceptions other than the AmplifyAlreadyConfiguredException, for examples |
Hi all this should be fixed by: Which has been released in v1.3.1 Please reopen this issue and comment in case you are still encountering this problem. |
@fjnoyp @Jordan-Nelson, I'm still having the same error. My DataStore version is 1.4.2. Exception has occurred.
PlatformException (PlatformException(AmplifyAlreadyConfiguredException, Translating platform exception failed.
Please take a look at https://github.com/aws-amplify/amplify-flutter/issues to see if there are any existing issues that match
your scenario, and file an issue with the details of the bug if there isn't.,
{recoverySuggestion: Do not add plugins after calling `Amplify.configure()`.,
message: AmplifyPlugins.AWSDataStorePlugin cannot be added after `Amplify.configure()`., underlyingError: }, null))} When I mute all exceptions, DataStore is not synced and returns only empty list. Future<void> _configureAmplify() async {
try {
if (!Amplify.isConfigured) {
await Amplify.addPlugins([
AmplifyAuthCognito(),
AmplifyDataStore(modelProvider: ModelProvider.instance),
AmplifyAPI(),
]);
await Amplify.configure(amplifyconfig);
debugPrint('Amplify configured successfully.');
} else {
debugPrint('Amplify is already configured.');
}
} on AmplifyAlreadyConfiguredException {
debugPrint('Amplify configuration failed.');
}
} |
I am running into this error now and guess what this error has been around for more than a year. Bugs like these which are not taken off for months by the amplify team, Always makes me question my decision to move from firebase to amplify. We are infact looking to move back to firebase because the team at amplify is being so careless with the management of this service, its just pathetic. Not done guys :/ |
Description
Every time i need to hot restart in the app it throws exception:
PlatformException (PlatformException(AmplifyAlreadyConfiguredException, Translating platform exception failed. Please take a look at https://github.com/aws-amplify/amplify-flutter/issues to see if there are any existing issues that match your scenario, and file an issue with the details of the bug if there isn't., {message: AmplifyPlugins.AWSCognitoAuthPlugin cannot be added after
Amplify.configure()
., recoverySuggestion: Do not add plugins after callingAmplify.configure()
., underlyingError: }, null))Amplify.isConfigured returns false so it is rightly trying to configure it again - but it already IS configured. This results in need to do a full stop and start of the app in order to see changes done in development.
Categories
Steps to Reproduce
Add the following into your app:
Screenshots
Platforms
Android Device/Emulator API Level
API 31
Environment
Dependencies
Device
iPhone SE 15.2
OS
iOS 15.2
CLI Version
8.3.1
Additional Context
No response
The text was updated successfully, but these errors were encountered: