Skip to content

DataStore queries do not complete on second app load on Android 7 #2055

Open
@HarkerTech

Description

@HarkerTech

Description

Have seen this issue in our production app, however we have also replicated it in the tutorial amplified_todo app (https://docs.amplify.aws/start/getting-started/add-api/q/integration/flutter/).

On a fresh boot (delete app on emulator and rebuild) the first DataStore sync/observeQuery runs as expected and returns results. However after restarting the app after the successful sync the query will fail to return any results. We did not observe any errors in the logs.

Have not tested on Android versions older than API 24, however on API 26 the queries completed successfully.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Storage

Steps to Reproduce

  1. Go through the AWS Amplify tutorial for Flutter (https://docs.amplify.aws/start/getting-started/add-api/q/integration/flutter/)
  2. Build and deploy on a Android 7 (API 24/25) emulator
  3. After app loads, restart the app
  4. App should continuously show loading indicator

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Android Device/Emulator API Level

API 24, API 25

Environment

amplified_todo % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-arm, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] VS Code (version 1.70.2)
[✓] Connected device (5 available)
[✓] HTTP Host Availability

• No issues found!

Dependencies

amplified_todo % flutter pub deps --no-dev --style=compact
Dart SDK 2.17.6
Flutter SDK 3.0.5
amplified_todo 1.0.0+1

dependencies:
- amplify_api 0.6.6 [amplify_api_android amplify_api_ios amplify_core amplify_flutter aws_common collection flutter meta plugin_platform_interface]
- amplify_auth_cognito 0.6.6 [amplify_auth_cognito_android amplify_auth_cognito_ios amplify_core aws_common collection flutter meta plugin_platform_interface]
- amplify_datastore 0.6.6 [flutter amplify_datastore_plugin_interface amplify_core plugin_platform_interface meta collection async]
- amplify_flutter 0.6.6 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios aws_common collection flutter meta plugin_platform_interface]
- cupertino_icons 1.0.5
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

transitive dependencies:
- amplify_api_android 0.6.6 [flutter]
- amplify_api_ios 0.6.6 [amplify_core flutter]
- amplify_auth_cognito_android 0.6.6 [flutter]
- amplify_auth_cognito_ios 0.6.6 [amplify_core flutter]
- amplify_core 0.6.6 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
- amplify_datastore_plugin_interface 0.6.6 [amplify_core collection flutter meta]
- amplify_flutter_android 0.6.6 [flutter]
- amplify_flutter_ios 0.6.6 [amplify_core 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
- crypto 3.0.2 [typed_data]
- http 0.13.5 [async http_parser meta path]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- json_annotation 4.6.0 [meta]
- material_color_utilities 0.1.4
- meta 1.7.0
- path 1.8.1
- plugin_platform_interface 2.1.2 [meta]
- 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

Device

Huawei P9

OS

Android 7.0

Deployment Method

Amplify CLI

CLI Version

9.2.1

Additional Context

No response

Amplify Config

const amplifyconfig = ''' {
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"api": {
"plugins": {
"awsAPIPlugin": {
"AmplifiedTODO": {
"endpointType": "GraphQL",
"endpoint": "",
"region": "ap-southeast-2",
"authorizationType": "API_KEY",
"apiKey": ""
}
}
}
},
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"UserAgent": "aws-amplify-cli/0.1.0",
"Version": "0.1.0",
"IdentityManager": {
"Default": {}
},
"AppSync": {
"Default": {
"ApiUrl": "",
"Region": "ap-southeast-2",
"AuthMode": "API_KEY",
"ApiKey": "",
"ClientDatabasePrefix": "AmplifiedTODO_API_KEY"
},
"AmplifiedTODO_AWS_IAM": {
"ApiUrl": "",
"Region": "ap-southeast-2",
"AuthMode": "AWS_IAM",
"ClientDatabasePrefix": "AmplifiedTODO_AWS_IAM"
}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "",
"Region": "ap-southeast-2"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "",
"AppClientId": "",
"Region": "ap-southeast-2"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"socialProviders": [],
"usernameAttributes": [
"EMAIL"
],
"signupAttributes": [],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
"REQUIRES_LOWERCASE",
"REQUIRES_NUMBERS",
"REQUIRES_SYMBOLS",
"REQUIRES_UPPERCASE"
]
},
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
}
}''';

Metadata

Metadata

Assignees

Labels

DocumentationImprovements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes).datastoreIssues related to the DataStore Categoryfeature-requestA request for a new feature or an enhancement to an existing API or category.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions