Closed fuzkabir closed 1 year ago
This is what I understand from your prompt:
You are using Authenticator with no custom setup.
You can sign in on web but on Android and Windows you get a 'User does not exist' exception.
Then when you close the android app and reopen you get a white screen. What future is running?
I am unable to reproduce your issue - I am able to sign up and sign in on Web and Android using the same user account. Did you use the code in the setup guide below to setup Authenticator in your application?
https://ui.docs.amplify.aws/flutter/connected-components/authenticator
@fjnoyp Thanks. I'm Sorry, I meant reopening as 'future running'.
The fact is I've been working on this project for 3 months now. Even last week I was able to log in using android and windows. As my 1st target is the web (then android) I test with the Web only for the last few days. I guess there may be any issues with the packages I've installed recently.
Yes, I'm using exactly mention in the following documentation https://ui.docs.amplify.aws/flutter/connected-components/authenticator
Code snippet (omitting the formatting parts):
return Authenticator(
authenticatorBuilder: (context, state) {
switch (state.currentStep) {
case AuthenticatorStep.signIn:
SignInForm(),
The same is done for sign-up and other actions.
I'm not using datastore as till now it's not supported for web. packages in Pubspec.yaml:
amplify_flutter: ^1.0.0-next.5
amplify_auth_cognito: ^1.0.0-next.5
amplify_authenticator: ^1.0.0-next.4
amplify_storage_s3: ^1.0.0-next.5
amplify_api: ^1.0.0-next.5
# Bloc libraries
equatable: ^2.0.3
bloc: ^8.0.3
flutter_bloc: ^8.0.1
auto_size_text: 3.0.0
built_collection: 5.1.1
built_value: 8.4.0
cached_network_image: 3.2.1
cloud_firestore: 4.2.0
cloud_firestore_platform_interface: 5.9.1
cloud_firestore_web: 3.1.1
dropdownfield: 1.0.0
flutter_animate: 1.0.0
flutter_cache_manager: 3.3.0
font_awesome_flutter: 10.1.0
from_css_color: 2.0.0
go_router: 3.1.0
google_fonts: 3.0.1
image_picker:
intl: 0.17.0
json_path: 0.4.1
mime_type: 1.0.0
page_transition: 2.0.4
percent_indicator: 4.2.2
pin_code_fields: 7.4.0
plugin_platform_interface: 2.1.3
provider: 6.0.4
rxdart: 0.27.4
shared_preferences: 2.0.15
sign_in_with_apple: 4.1.0
sign_in_with_apple_platform_interface: 1.0.0
sign_in_with_apple_web: 1.0.1
sqflite: 2.2.0+2
timeago: 3.2.2
url_launcher: 6.1.5
convex_bottom_bar: ^3.1.0+1
syncfusion_flutter_pdf:
syncfusion_flutter_barcodes:
qr_flutter:
chewie:
video_player:
image_cropper: ^3.0.1
dotted_border: ^2.0.0+3
dropdown_button2:
flutter_phoenix: "^1.0.0"
multi_select_flutter:
multi_select_search:
It's been 36 hours now but no response. @dnys1, last time your support was tremendous. Can you please have a look at this?
Well, I have done some tests. As it is for production, I need to advance.
This time I'm using the exact example shown at https://pub.dev/packages/amplify_authenticator inside main.dart
Cut off all the dependencies to:
amplify_auth_cognito: ^0.6.0
amplify_authenticator: ^0.2.0
amplify_flutter: ^0.6.0
The result is it's working in Android but not in Windows.
Then added all previous dependencies and the old main.dart
. This time Android is working but for sure android is not.
I don't know how it got fixed. Whatever it is undoubtedly a bug. Because this UserNotFoundException
is not the first time it has occurred and may return anytime. The development team needs to consider this fact.
@fjnoyp, you should check the Windows. I'm not closing until the Windows issue is solved. It is also a part of my deployment. Thanks.
Hi @fuzkabir sorry for the lack of response on this issue. I'll take a look today.
Hi @fuzkabir, I've tried to reproduce this in Windows using both debug and release builds but I've been unsuccessful so far. Would you be able to share the precise steps taken to reproduce this, including how you verify the user has been created successfully?
Hi, @dnys1, Thanks for your response. Pardon, unsuccessful means unsuccessful to reproduce the issue or to log in? However, it's the project I've been working on and you may remember the last issue that also happened on this. Log in on windows was working, but one day I found it not. Currently, the Web and Android are working with no problem at all.
So, the steps:
in pubspec.yaml
dependencies:
amplify_auth_cognito: ^1.0.0-next.5+1
amplify_authenticator: ^1.0.0-next.4+1
amplify_flutter: ^1.0.0-next.5+1
main.dart
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
import 'amplifyconfiguration.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
_configureAmplify();
}
Future<void> _configureAmplify() async {
try {
await Amplify.addPlugin(AmplifyAuthCognito());
await Amplify.configure(amplifyconfig);
} on Exception catch (e) {
print('Could not configure Amplify: $e');
}
}
@override
Widget build(BuildContext context) {
return Authenticator(
child: MaterialApp(
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
builder: Authenticator.builder(),
home: const LoggedInScreen(),
),
);
}
}
class LoggedInScreen extends StatelessWidget {
const LoggedInScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: const [
Text('Logged In'),
SignOutButton(),
],
),
),
);
}
}
User Creation is done just by the process in the authorization. I Provide Sign Up credentials, Get the code by email and type it and Verified. All the users I'm trying with are listed as successfully verified in Cognito. They are working perfectly on Android and Web.
The remaining of Mason.yaml
bricks:
amplify_starter: 0.1.0
amplifyconfiguration.dart
const amplifyconfig = ''' {
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"api": {
"plugins": {
"awsAPIPlugin": {
"my_app": {
"endpointType": "GraphQL",
"endpoint": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
"region": " my-region",
"authorizationType": "AMAZON_COGNITO_USER_POOLS"
}
}
}
},
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"UserAgent": "aws-amplify-cli/0.1.0",
"Version": "0.1.0",
"IdentityManager": {
"Default": {}
},
"AppSync": {
"Default": {
"ApiUrl": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
"Region": " my-region",
"AuthMode": "AMAZON_COGNITO_USER_POOLS",
"ClientDatabasePrefix": "my_app_AMAZON_COGNITO_USER_POOLS"
},
"my_app_AWS_IAM": {
"ApiUrl": "https://api_key.appsync-api. my-region.amazonaws.com/graphql",
"Region": " my-region",
"AuthMode": "AWS_IAM",
"ClientDatabasePrefix": "my_app_AWS_IAM"
}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": " my-region:pool_id",
"Region": " my-region"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": " my-region_zZE2flX89",
"AppClientId": "myAppClientId",
"Region": " my-region"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"signupAttributes": [
"EMAIL",
"PHONE_NUMBER"
],
"socialProviders": [],
"usernameAttributes": [
"EMAIL",
"PHONE_NUMBER"
],
"verificationMechanisms": [
"EMAIL"
]
}
},
"S3TransferUtility": {
"Default": {
"Bucket": "my_app_bucket",
"Region": " my-region"
}
},
"DynamoDBObjectMapper": {
"Default": {
"Region": " my-region"
}
}
}
}
},
"storage": {
"plugins": {
"awsS3StoragePlugin": {
"bucket": "my_app_S3",
"region": " my-region",
"defaultAccessLevel": "guest"
},
"awsDynamoDbStoragePlugin": {
"name": "spc",
"region": " my-region",
"arn": "arn:aws:dynamodb: my-region:table_id:table/spc",
"partitionKeyName": "id",
"partitionKeyType": "S"
}
}
}
}''';
Compared to the Web and Android, the response in Windows is quick, It seems it has not even gotten connected to cognito.
Due to the time zone, I will be able to reply after 6 hours.
Thanks again.
Today I updated flutter, no change.
I missed some additional details yesterday.
When I try to Sign up using windows It accepts the sign-up form and takes me to the verification part. But when I try to confirm the verification code for the first time, it shows the User does not exist
for the first time, and when I press the confirm for 2nd time it shows, User cannot be confirmed, Current status is CONFIRMED
. And the irony is the user has been shown as confirmed in the Cognito user pool. Undoubtedly, the unsuccessfully signed-up user got easily log-in into the Web or Android. And just to confirm, for log-in into windows, the user I'm trying with has not been created this way.
This same experience I had in Android twice, and eventually got solved. This time is the first for windows.
Thank you for the extra information, @fuzkabir. I believe I was able to find some issues based off this. I will work to add fixes and tests to make sure they do not pop up again.
I appreciate your patience and will keep you posted here.
Thank you, @dnys1.
It's real that I'm suffering from this issue right now but I'm sharing details so that Flutter Amplify becomes the best framework. This is my 3rd project with amplify and 1st with flutter. If this works perfectly, I'll have a complete track change to Flutter Amplify.
Thanks for your support. Our goal is the same as yours - to make Amplify Flutter the best framework possible!
I am prioritizing this work and will have an update for you shortly.
Hi @fuzkabir, sorry for the delayed response here. I did some investigation and was able to uncover a couple issues in the Authenticator which could be contributing to this issue. It took a while to get the PR merged and released, but I believe this should result in a better experience.
Can you update to the latest version of the libraries and let me know if you still experience this issue?
Thanks again for your patience and sorry for the lack of updates!
Sorry @dnys1 for the delay, I really appreciate your effort. I'm right now in a critical state of my project and it'd take a few more days. Obviously, the authentication update is urgent for the project. Once the stage is done, I'll check it and get back to you. Thanks again.
Hi @fuzkabir, just wanted to follow up and see if you had noticed this problem since we last spoke. I believe it has been resolved. If not, I'd love to investigate more if you're able to provide an up-to-date set of reproduction steps.
Thanks for your patience during this.
@dnys1 Really sorry as I have been implementing a Webrtc add-on to the project for the last 25 days, and everyday there's a new challenge. Another issue is that I have customized the authenticator to use it anyway.
Today I tried to upgrade to 1.0.0-next.5+2 but my old code is generating new problems like:
final request = ModelQueries.get(AppUser.classType, queriedAppUser.id!);
Error: The argument type 'String' can't be assigned to the parameter type 'ModelIdentifier
I know It's fixable and I will. but for now, fixing will drive my attention away from the problem I've working on.
So, Now I need a project where I can check with minimal requirements to respond to you. I've found your amplify_authenticator test project but it's showing the error like: Because amplify_authenticator_test depends on both amplify_lints from hosted and amplify_lints from the path, version solving failed. If can provide me with an URL of a project with minimal setup or requirement so that I can test it and I can reply to you ASAP. My project and the deadlines are not providing any extra time for the testing now. I hope you can understand and help on this.
Thanks a lot again.
Hi @fuzkabir. So we recently released v1 of Amplify Flutter as stable. We published a migration guide which may help with some of the breaking changes you noticed.
I've created a barebones repo with just the Authenticator code and added you as a collaborator. If you're able to reproduce it there, please feel free to push your changes. It would be greatly appreciated! https://github.com/dnys1/authenticator_repro
Closing for now. If you end up experiencing this on v1, please do reopen with any new logs/errors and reproduction steps. I'll be happy to help diagnose and to make sure it's resolved.
Description
Front End
SignInForm(),
*There's no customization. With android studio Log in Process is successful with the web. But both android emulator and Windows are showing the message:User does not exist
and the following message in the console:
Built apk files working ( not UserNotFoundException) in devices just after installation. but once closed no response (just a white screen) in future runs.
dependencies:
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Flutter Version
3.7.0-1.5.pre
Amplify Flutter Version
1.0.0-next.5
Deployment Method
Amplify CLI
Schema
No response