amplify-flutter icon indicating copy to clipboard operation
amplify-flutter copied to clipboard

InvalidParameterException thrown when saving birthdate attribute

Open tilakpatel22 opened this issue 3 years ago • 12 comments
trafficstars

I'm using the correct format of date MM/DD/YYYY still it is giving me an error.. help me to resolve it, please

Exception:

E/flutter (23340): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: InvalidParameterException(message: One or more parameters are incorrect., recoverySuggestion: Enter correct parameters., underlyingException: com.amazonaws.services.cognitoidentityprovider.model.InvalidParameterException: Attributes did not conform to the schema: birthdate: String must be no shorter than 10 characters

tilakpatel22 avatar Aug 12 '22 09:08 tilakpatel22

Hi @12tilak34 - I believe the format should be "YYYY-MM-DD", which follows the open ID spec.

If you are using that format, can you provide the code sample that is throwing this exception so that I can attempt to reproduce it? Thanks.

Jordan-Nelson avatar Aug 12 '22 11:08 Jordan-Nelson

Can you also let me know which version of amplify flutter you are using and which platform you are running on? Thanks.

Jordan-Nelson avatar Aug 12 '22 11:08 Jordan-Nelson

I had tried both formats. I'm using amplify version 9.0.1 and running on windows, code editor is android studio

tilakpatel22 avatar Aug 12 '22 11:08 tilakpatel22

you can download the dart file here:- https://www.mediafire.com/file/mbx9sigi8ntdz2v/SignUpTest.dart/file i had removed birthdate from everywhere because it was causing it error you can add it and check... it won't take more than 2 minutes

tilakpatel22 avatar Aug 12 '22 12:08 tilakpatel22

9.0.1 is likely the version of the Amplify CLI that you are using. If you are running on Windows you must be using the latest dev-preview (1.0.0) of amplify flutter. We will attempt to reproduce this on Windows with that version.

Jordan-Nelson avatar Aug 12 '22 12:08 Jordan-Nelson

@12tilak34 Can you share the output of flutter pub deps --no-dev --style=compact so that I can confirm the versions of each amplify package?

is Windows the target platform, or are you running it on an Android emulator?

Jordan-Nelson avatar Aug 12 '22 13:08 Jordan-Nelson

I was unable to reproduce this with the latest dev-preview version of amplify flutter on Windows. If you provide the info above I can attempt to reproduce it with the version you are using.

Jordan-Nelson avatar Aug 12 '22 15:08 Jordan-Nelson

@Jordan-Nelson

Dart SDK 2.17.6 Flutter SDK 3.0.5 fincept 1.0.0+1

dependencies:

  • amplify_analytics_pinpoint 0.6.5 [amplify_analytics_pinpoint_android amplify_analytics_pinpoint_ios amplify_core aws_common flutter meta]
  • amplify_auth_cognito 0.6.5 [amplify_auth_cognito_android amplify_auth_cognito_ios amplify_core aws_common collection flutter meta plugin_platform_interface]
  • amplify_authenticator 0.2.1 [amplify_auth_cognito amplify_core amplify_flutter aws_common collection flutter flutter_localizations intl]
  • amplify_datastore 0.6.5 [flutter amplify_datastore_plugin_interface amplify_core plugin_platform_interface meta collection async]
  • amplify_flutter 0.6.5 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios aws_common collection flutter meta plugin_platform_interface]
  • amplify_storage_s3 0.6.5 [amplify_storage_s3_android amplify_storage_s3_ios amplify_core aws_common flutter meta plugin_platform_interface]
  • aws_lambda_api 1.2.0 [shared_aws_api]
  • cupertino_icons 1.0.5
  • email_validator 2.1.17
  • flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
  • flutter_glow 0.2.0 [flutter]
  • flutter_svg 1.0.3 [flutter meta path_drawing vector_math xml]
  • google_fonts 3.0.1 [flutter http path_provider crypto]
  • image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
  • local_auth 2.1.0 [flutter intl local_auth_android local_auth_ios local_auth_platform_interface local_auth_windows]
  • pin_code_fields 7.4.0 [flutter]
  • responsive_framework 0.2.0 [flutter collection]
  • settings_ui 2.0.2 [flutter]
  • showcaseview 1.1.6 [flutter]
  • upi_india 3.0.1 [flutter]

transitive dependencies:

  • amplify_analytics_pinpoint_android 0.6.5 [flutter]
  • amplify_analytics_pinpoint_ios 0.6.5 [flutter]
  • amplify_auth_cognito_android 0.6.5 [flutter]
  • amplify_auth_cognito_ios 0.6.5 [amplify_core flutter]
  • amplify_core 0.6.5 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
  • amplify_datastore_plugin_interface 0.6.5 [amplify_core collection flutter meta]
  • amplify_flutter_android 0.6.5 [flutter]
  • amplify_flutter_ios 0.6.5 [amplify_core flutter]
  • amplify_storage_s3_android 0.6.5 [flutter]
  • amplify_storage_s3_ios 0.6.5 [flutter]
  • async 2.8.2 [collection meta]
  • aws_common 0.1.1 [async collection http meta stream_transform uuid]
  • characters 1.2.0
  • charcode 1.3.1
  • clock 1.1.0
  • collection 1.16.0
  • cross_file 0.3.3+1 [js meta]
  • crypto 3.0.2 [typed_data]
  • ffi 2.0.1
  • file 6.1.2 [meta path]
  • flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
  • flutter_plugin_android_lifecycle 2.0.6 [flutter]
  • flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
  • http 0.13.4 [async http_parser meta path]
  • http_parser 4.0.1 [collection source_span string_scanner typed_data]
  • image_picker_android 0.8.5+2 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
  • image_picker_for_web 2.1.8 [flutter flutter_web_plugins image_picker_platform_interface]
  • image_picker_ios 0.8.5+6 [flutter image_picker_platform_interface]
  • image_picker_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface]
  • intl 0.17.0 [clock path]
  • js 0.6.4
  • json_annotation 4.5.0 [meta]
  • local_auth_android 1.0.5 [flutter flutter_plugin_android_lifecycle intl local_auth_platform_interface]
  • local_auth_ios 1.0.7 [flutter intl local_auth_platform_interface]
  • local_auth_platform_interface 1.0.4 [flutter intl plugin_platform_interface]
  • local_auth_windows 1.0.1 [flutter local_auth_platform_interface]
  • material_color_utilities 0.1.4
  • meta 1.7.0
  • path 1.8.1
  • path_drawing 1.0.1 [vector_math meta path_parsing flutter]
  • path_parsing 1.0.1 [vector_math meta]
  • path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
  • path_provider_android 2.0.19 [flutter path_provider_platform_interface]
  • path_provider_ios 2.0.11 [flutter path_provider_platform_interface]
  • path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories]
  • path_provider_macos 2.0.6 [flutter path_provider_platform_interface]
  • path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface]
  • path_provider_windows 2.1.2 [ffi flutter path path_provider_platform_interface win32]
  • petitparser 5.0.0 [meta]
  • platform 3.1.0
  • plugin_platform_interface 2.1.2 [meta]
  • process 4.2.4 [file path platform]
  • shared_aws_api 1.2.0 [crypto http meta xml intl uuid collection]
  • sky_engine 0.0.99
  • source_span 1.8.2 [collection path term_glyph]
  • stream_transform 2.0.0
  • string_scanner 1.1.0 [charcode source_span]
  • term_glyph 1.2.0
  • typed_data 1.3.1 [collection]
  • uuid 3.0.6 [crypto]
  • vector_math 2.1.2
  • win32 2.7.0 [ffi]
  • xdg_directories 0.2.0+1 [meta path process]
  • xml 5.4.1 [collection meta petitparser]

tilakpatel22 avatar Aug 12 '22 18:08 tilakpatel22

Thanks. It looks like you are using amplify_flutter v0.6.5. Can you confirm that you are running on an Android emulator?

Jordan-Nelson avatar Aug 12 '22 18:08 Jordan-Nelson

no i was running on my phone but i tried on emulator also but it didn't work

tilakpatel22 avatar Aug 12 '22 18:08 tilakpatel22

@12tilak34 - I am unable to reproduce this with amplify_flutter v0.6.5 on an Android emulator. I am able to call signUp with a birthdate in either format - YYYY-MM-DD or MM/DD/YYYY and it is working as expected.

Can you confirm that the value being passed to Amplify is in that format? For testing purposes, can you hard code the date? This will allow me to attempt to reproduce it with the exact same value you are using.

If you are still experiencing this issue after confirming the format, can you please provide the code you are using, and include the hard coded date you are using?

Thanks.

Jordan-Nelson avatar Aug 12 '22 18:08 Jordan-Nelson

I will try the hard coded data also but when I take input from user side it generally gives me error.. i will update you this issue in some hours because it's night here so i will try the code tomorrow

tilakpatel22 avatar Aug 12 '22 19:08 tilakpatel22

@12tilak34 - Let me know if you were able to try to reproduce this with the value hard coded. Thanks.

Jordan-Nelson avatar Aug 16 '22 13:08 Jordan-Nelson

Hello @12tilak34 - I am going to close this out since it has been a while without an update and I was unable to reproduce this. If you are able to reproduce this, please open a new issue. It would be helpful to include a minimal reproduction includes the date you are having issues with.

Jordan-Nelson avatar Aug 24 '22 19:08 Jordan-Nelson