A declarative library with an easy-to-use interface for building Flutter applications on AWS.

Overview

AWS Amplify

discord CircleCI

Amplify Flutter

AWS Amplify provides a declarative and easy-to-use interface across different categories of cloud operations. Our default implementation works with Amazon Web Services (AWS), but AWS Amplify is designed to be open and pluggable for any custom backend or service. See AWS Amplify for further details about the Amplify Framework.

We are iterating and looking for feedback and collaboration, so please let us know your feedback on our direction and roadmap.

⚠️ For breaking changes from the developer preview versions please refer to this issue for migration details.

Supported Amplify Categories

  • Authentication: APIs and building blocks for developers who want to create user authentication experiences with Amazon Cognito.

  • Analytics: Easily collect analytics data for your app with Pinpoint. Analytics data includes user sessions and other custom events that you want to track in your app.

  • Storage: Provides a simple mechanism for managing user content for your app in public, protected or private storage buckets with Amazon S3.
  • DataStore: A programming model for leveraging shared and distributed data without writing additional code for offline and online scenarios, which makes working with distributed, cross-user data just as simple as working with local-only data.
  • API (Rest): Provides a simple solution when making HTTP requests. It provides an automatic, lightweight signing process which complies with AWS Signature Version 4.
  • API (GraphQL): Interact with your GraphQL server or AWS AppSync API with an easy-to-use & configured GraphQL client.

To Be Implemented

  • Predictions
  • Storage Hub Events (Listening to the Amplify Storage events)

Amplify for Flutter currently supports iOS and Android platforms.

Documentation

Flutter Development Guide

Amplify for Flutter is an open-source project and welcomes contributions from the Flutter community, see Contributing.

Prerequisites

Getting Started with Flutter app development and Amplify

  • Clone this repository
  • Install Amplify in a Flutter project
  • Add basic Amplify functionality to your project using one of the supported categories
  1. git clone [email protected]:aws-amplify/amplify-flutter.git

  2. Open your Flutter project. If you do not have an active Flutter project, you can create one after installing the Flutter development tooling and running flutter create <project-name> in your terminal.

  3. Using the Amplify CLI, run amplify init from the root of your project:

See Amplify CLI Installation

==> amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project helloAmplify
? Enter a name for the environment dev
? Choose your default editor: Visual Studio Code
? Choose the type of app that you\'re building flutter
Please tell us about your project
Only the following resource types are supported:
 * Auth
 * Analytics
 * Storage
 * API
? Where do you want to store your configuration file? ./lib/
  1. Add Amplify categories (choose defaults for this example):

    $ amplify add auth
    $ amplify add analytics
  2. Push changes to the cloud to provision the backend resources:

    $ amplify push
  3. In your pubspec.yaml file, add the following to dependencies:

Note: Do not include dependencies in your pubspec file that you are not using in your app. This can cause a configuration error in the underlying SDK.

dependencies:
  flutter:
    sdk: flutter
  amplify_flutter:
    path: /{path to your local amplify-flutter}/amplify-flutter/packages/amplify_flutter
  amplify_analytics_pinpoint:
    path: /{path to your local amplify-flutter}/amplify-flutter/packages/amplify_analytics_pinpoint
  amplify_auth_cognito:
    path: /{path to your local amplify-flutter}/amplify-flutter/packages/amplify_auth_cognito
  1. From the terminal run
flutter pub get
  1. In your main.dart file, add:
import 'package:flutter/material.dart';
import 'package:amplify_flutter/amplify.dart';
import 'package:amplify_analytics_pinpoint/amplify_analytics_pinpoint.dart';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';

import 'amplifyconfiguration.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _amplifyConfigured = false;

  @override
  void initState() {
    super.initState();
  }

  void _configureAmplify() async {
    if (!mounted) return;

    // Add Pinpoint and Cognito Plugins
    Amplify.addPlugin(AmplifyAuthCognito());
    Amplify.addPlugin(AmplifyAnalyticsPinpoint());

    // Once Plugins are added, configure Amplify
    try {
      await Amplify.configure(amplifyconfig);
      setState(() {
        _amplifyConfigured = true;
      });
    } on AmplifyAlreadyConfiguredException {
      print(
          "Amplify was already configured. Looks like app restarted on android.");
    }

  }

  // Send an event to Pinpoint
  void _recordEvent() async {
    AnalyticsEvent event = AnalyticsEvent('test');
    event.properties.addBoolProperty('boolKey', true);
    event.properties.addDoubleProperty('doubleKey', 10.0);
    event.properties.addIntProperty('intKey', 10);
    event.properties.addStringProperty('stringKey', 'stringValue');
    Amplify.Analytics.recordEvent(event: event);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Amplify example app'),
          ),
          body: ListView(padding: EdgeInsets.all(10.0), children: <Widget>[
            Center(
              child: Column (
                children: [
                  const Padding(padding: EdgeInsets.all(5.0)),
                  ElevatedButton(
                    onPressed: _amplifyConfigured ? null : _configureAmplify,
                    child: const Text('configure Amplify')
                  ),
                  ElevatedButton(
                    onPressed: _amplifyConfigured ? _recordEvent : null,
                    child: const Text('record event')
                  )
                ]
              ),
            )
          ])
      )
    );
  }
}

For iOS builds complete the following steps (from the root of your project):

  • rm ios/Podfile
  • flutter build ios
  • Modify the ios/Podfile and replace the second line with: platform :ios, '11.0'.

This ensures that your Flutter project is running the same ios version that the Amplify plugins are built on.

  1. From the root of your project, execute flutter run in the terminal.

Make sure that an Android or iOS device is already running; this can be a virtual device started from Android Studio.

Click Configure Amplify, then Record Event. From the terminal (in the root of your project) run amplify console analytics. This will open the Amazon Pinpoint console for your project in your default web browser. Within about a minute you should start seeing the events populating in the Events section of then Pinpoint console.

For further documentation and Amplify Category API usage, see the documentation.


Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.

Comments
  • [RFC]: Amplify Flutter

    [RFC]: Amplify Flutter

    This issue is a Request For Comments (RFC). It is intended to elicit community feedback regarding support for Amplify library in Flutter platform. Please feel free to post comments or questions here.

    Purpose

    Currently there is no official support for integrating with Amplify libraries in Flutter apps. This RFC goes over a proposal to build and release Amplify libraries in pub.dev that can be used in cross platform flutter apps.

    Goals

    • Amplify iOS and Amplify Android parity: We would like to support all the use cases supported by these platforms in Amplify Flutter, including the following categories
      • Analytics
      • API (Rest/GraphQL)
      • Authentication (including Hosted UI)
      • DataStore
      • Predictions
      • Storage
      • Hub Events (Listening to the Amplify events)
    • Consistency with other platforms: Keep the public interface and API behavior consistent with Amplify iOS and Android libraries.
    • Pluggability: Customers should be able to implement/add their own cloud provider plugins for a given category.
    • UI Components: Provide a set of UI components intended to help developers leverage Amplify categories such as API, Auth, Storage etc.

    Definitions

    Categories: Use case driven abstractions such as Auth, Analytics, Storage that provide easy to use interfaces. Providers: A cloud provider or a service provider such as Cognito, Auth0 in Auth category; Kinesis, Pinpoint and Firehose in Analytics Category; Rekognition, Textract in Predictions Category. Plugins: Also called Amplify Plugins, bind providers to categories. They implement provider functionalities adhering to categories easy-to-use interfaces. Amplify Plugins already exist in native platforms (iOS/Android), this RFC explores creation of similar plugins in Flutter. Flutter Plugins/Platform Plugins/Federated Plugins: These are native platform code and modules that is called from flutter apps or libraries over a method channel.

    Proposed Solution

    High Level Overview

    Amplify flutter will be architected as a pluggable interface across all the categories listed in the Goals. The pluggable interface will allow plugging in different cloud providers (e.g. Auth0 or Cognito for Auth category) which can be written either entirely in Dart or using Flutter's Platform Plugins to reuse native (iOS and/or android) modules.

    The core of Amplify Flutter will be written in Dart which provides the pluggable interface and out of the box AWS cloud provider plugins will utilize existing Amplify Android and Amplify iOS libraries as Flutter's federated plugins. This means that we will not be implementing a Dart aws-sdk right away as AWS service calls will be made by Amplify Android/iOS libraries.

    The Amplify flutter library will be compatible with Amplify CLI to create and provision your cloud providers' resources. Amplify CLI will generate a configuration file to easily configure your Flutter app to use these resources.

    Pros

    1. We can reuse most of the existing Amplify native libraries' AWS providers and ship to customers faster.
    2. Some initial bench-marking proves that executing native platform code is generally faster than dart code.
    3. New features introduced in native libraries can be made available in Flutter with very minimal to no change.
    4. Provides flexibility to write providers' (AWS or others) implementation entirely in Dart if needed in the future.

    Amplify Flutter(2)

    Developer Experience

    • Creating and provisioning resources will remain the same with amplify CLI https://docs.amplify.aws/cli/start/workflows
    • Integrating with Amplify Flutter
      • Flutter Apps will import AmplifyCore and the plugins they want to use in the app.
      • In the app, developers will be required to call Amplify.addPlugin() for each plugin they import e.g. Amplify.addPlugin(CognitoAuthPlugin())
      • Developers will call Amplify.Category.<API> to use installed plugins, e.g. Amplify.Auth.signIn()
    • Developing and debugging Amplify Flutter
      • Refer official flutter guide to learn how to debug provider plugins that are written entirely in Dart and the ones that use platform federated plugins.
    • Using Amplify UI components for Flutter - Coming Soon

    FAQs

    Q. Which versions of Android and iOS are supported? Same versions as supported by Amplify Android and Amplify iOS libraries.

    Q. How will escape hatches work with Amplify plugins that use native libraries? Coming Soon.

    Q. How will events that are emitted in native libraries reach Flutter apps. We will use Flutter's event channels to subscribe events on the native platform and transmit them over to Dart end.

    Q. Will web and Desktop platform be supported? Not right away, our goal with this design is to keep the architecture flexible such that more platforms can be supported in the future.

    Q. Can I migrate my Amplify CLI generated config from Android, iOS or JS platform to flutter? Not right now. We will look into the feasibility of supporting this in the future.

    feature-request 
    opened by Amplifiyer 73
  • Not able to get any exceptions in iOS

    Not able to get any exceptions in iOS

    I have created an application and uploaded to the TestFlight and Appstore also. First time user was able to login and then for next patch release I have uploaded to the TestFlight. Then am not able to signin only. Tried to catch the exception using toast/alert messages, firebase crashlytics. Then connected to the device which i have already installed the app from Testflight. And i run the application in real device tried to see console error, not able to see the exception again. Then i tried with fetchAuthSession didn't get any exception. Am getting only response for

    final user = await Amplify.Auth.getCurrentUser();
    print('user===${user.userId}');
    

    I was able to get user id. But for all other cognito api's am not getting any exceptions or not even the response.

    Software version 15.5 Model iPhone 12

    Note: The same code base is working for android device and simulator also.

    pending-close-response-required Auth not-reproducible pending-triage 
    opened by Sunsiha 53
  • iOS Simulator Fails on Startup

    iOS Simulator Fails on Startup

    Description

    On startup, the iOS simulator fails with the error:

    Launching lib/main.dart on iPhone 12 in debug mode...
    Running Xcode build...
    Xcode build done.                                           19.8s
    Debug service listening on ws://127.0.0.1:49189/gfJ0j2P_-ZY=/ws
    Syncing files to device iPhone 12...
    Amplify/ModelPrimaryKey.swift:60: Fatal error: Primary key field named (id) not found in schema fields.
    Lost connection to device.
    

    This error occurs for all emulated iOS devices

    Categories

    • [ ] Analytics
    • [ ] API (REST)
    • [X] API (GraphQL)
    • [X] Auth
    • [ ] Authenticator
    • [X] DataStore
    • [X] Storage

    Steps to Reproduce

    1. Select iOS device (in this case iPhone 12)
    2. Tap 'Run' or 'Debug'
    3. Startup fails with above error

    Screenshots

    No response

    Platforms

    • [X] iOS
    • [ ] Android
    • [ ] Web
    • [ ] macOS
    • [ ] Windows
    • [ ] Linux

    Android Device/Emulator API Level

    API 32+

    Environment

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.0.3, on macOS 12.5.1 21G83 darwin-x64, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.2)
    [✓] VS Code (version 1.71.0)
    [✓] Connected device (2 available)
    [✓] HTTP Host Availability
    
    • No issues found!
    [peter:~/Development/elys_mobile/ios] ianmccal% flutter doctor -v
    [✓] Flutter (Channel stable, 3.0.3, on macOS 12.5.1 21G83 darwin-x64, locale en-US)
        • Flutter version 3.0.3 at /Users/ianmccal/Development/Flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 676cefaaff (3 months ago), 2022-06-22 11:34:49 -0700
        • Engine revision ffe7b86a1e
        • Dart version 2.17.5
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/ianmccal/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.71.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.48.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 12.5.1 21G83 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 105.0.5195.102
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    [peter:~/Development/elys_mobile/ios] ianmccal%
    

    Dependencies

    [peter:~/Development/elys_mobile] ianmccal% flutter pub deps --no-dev --style=compact
    Dart SDK 2.17.5
    Flutter SDK 3.0.3
    elys_mobile 1.0.002+73
    
    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_core 0.6.6 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
    - 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]
    - amplify_storage_s3 0.6.6 [amplify_storage_s3_android amplify_storage_s3_ios amplify_core aws_common flutter meta plugin_platform_interface]
    - camera 0.10.0+1 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver]
    - cupertino_icons 1.0.5
    - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
    - flutter_libphonenumber 1.2.4 [flutter]
    - flutter_slidable 2.0.0 [flutter]
    - flutter_spinkit 5.1.0 [flutter]
    - 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]
    - intl 0.17.0 [clock path]
    - 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]
    - permission_handler 10.0.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
    - sentry_flutter 6.9.1 [flutter flutter_web_plugins sentry package_info_plus meta]
    - url_launcher 6.1.5 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
    - video_player 2.4.7 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web]
    
    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_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]
    - amplify_storage_s3_android 0.6.6 [flutter]
    - amplify_storage_s3_ios 0.6.6 [flutter]
    - async 2.8.2 [collection meta]
    - aws_common 0.1.1 [async collection http meta stream_transform uuid]
    - camera_android 0.10.0+2 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform]
    - camera_avfoundation 0.9.8+5 [camera_platform_interface flutter stream_transform]
    - camera_platform_interface 2.2.0 [cross_file flutter plugin_platform_interface stream_transform]
    - camera_web 0.3.0 [camera_platform_interface flutter flutter_web_plugins stream_transform]
    - 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]
    - csslib 0.17.2 [source_span]
    - ffi 2.0.1
    - file 6.1.4 [meta path]
    - flutter_plugin_android_lifecycle 2.0.7 [flutter]
    - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
    - html 0.15.0 [csslib source_span]
    - http 0.13.5 [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.6 [flutter image_picker_platform_interface]
    - image_picker_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface]
    - js 0.6.4
    - json_annotation 4.6.0 [meta]
    - matcher 0.12.11 [stack_trace]
    - material_color_utilities 0.1.4
    - meta 1.7.0
    - package_info_plus 1.4.3+1 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web]
    - package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path]
    - package_info_plus_macos 1.3.0 [flutter]
    - package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface]
    - package_info_plus_web 1.0.5 [flutter flutter_web_plugins http meta package_info_plus_platform_interface]
    - package_info_plus_windows 2.1.0 [package_info_plus_platform_interface ffi flutter win32]
    - path 1.8.1
    - path_provider_android 2.0.20 [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.3 [ffi flutter path path_provider_platform_interface win32]
    - permission_handler_android 10.0.0 [flutter permission_handler_platform_interface]
    - permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface]
    - permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
    - permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface]
    - platform 3.1.0
    - plugin_platform_interface 2.1.2 [meta]
    - process 4.2.4 [file path platform]
    - quiver 3.1.0 [matcher]
    - sentry 6.9.1 [http meta stack_trace uuid]
    - sky_engine 0.0.99
    - source_span 1.8.2 [collection path term_glyph]
    - stack_trace 1.10.0 [path]
    - stream_transform 2.0.0
    - string_scanner 1.1.0 [charcode source_span]
    - term_glyph 1.2.0
    - typed_data 1.3.1 [collection]
    - url_launcher_android 6.0.17 [flutter url_launcher_platform_interface]
    - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface]
    - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface]
    - url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface]
    - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface]
    - uuid 3.0.6 [crypto]
    - vector_math 2.1.2
    - video_player_android 2.3.9 [flutter video_player_platform_interface]
    - video_player_avfoundation 2.3.5 [flutter video_player_platform_interface]
    - video_player_platform_interface 5.1.4 [flutter plugin_platform_interface]
    - video_player_web 2.0.12 [flutter flutter_web_plugins video_player_platform_interface]
    - win32 3.0.0 [ffi]
    - xdg_directories 0.2.0+2 [meta path process]
    [peter:~/Development/elys_mobile] ianmccal%
    

    Device

    all iOS Devices

    OS

    iOS 14.5

    Deployment Method

    Amplify CLI

    CLI Version

    9.0.0

    Additional Context

    This emulation worked as of 3 September.

    Amplify Config

    please be more specific -- I am unsure what is needed here.

    bug pending-close-response-required DataStore 
    opened by ianfmc 32
  • FAILURE: Build failed with an exception. Flutter 2.0

    FAILURE: Build failed with an exception. Flutter 2.0

    Describe the bug FAILURE: Build failed with an exception.

    • Where:

    Build file '*/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.1.0/android/build.gradle' line: 62

    • What went wrong: A problem occurred evaluating root project 'amplify_auth_cognito'.

    Cannot convert a null value to an object of type Dependency. The following types/formats are supported: - Instances of Dependency. - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'. - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0']. - FileCollections, for example files('some.jar', 'someOther.jar'). - Projects, for example project(':some:project:path'). - ClassPathNotation, for example gradleApi().

    Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    To Reproduce Steps to reproduce the behavior:

    1. Run flutter build apk --release // flutter build apk
    2. Make sure you are running Flutter 2.0
    3. You will see the error posted above in the output

    Expected behavior I am able to build an apk successfully

    Screenshots If applicable, add screenshots to help explain your problem.

    Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):

    • Android
    • iOS
    Android pending-close-response-required Auth Build 
    opened by Yonkokilasi 30
  •  Unhandled Exception: Amplify plugin was not added

    Unhandled Exception: Amplify plugin was not added

    I am using this code

    void _configureAmplify() async {
     
    
        // Add Pinpoint and Cognito Plugins
        AmplifyAnalyticsPinpoint analyticsPlugin = AmplifyAnalyticsPinpoint();
        AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
        amplifyInstance.addPlugin(authPlugins: [authPlugin]);
        amplifyInstance.addPlugin(analyticsPlugins: [analyticsPlugin]);
    
        // Once Plugins are added, configure Amplify
        await amplifyInstance.configure(amplifyconfig);
        try {
    
            _amplifyConfigured = true;
    
        } catch (e) {
          print(e);
        }
    
      }
    

    when in run _configureAmplify() it showing
    I/flutter (24087): ``` Auth plugin was not added
    E/flutter (24087): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Amplify plugin was not added

    Core 
    opened by FlutterEngineer 30
  • How to use SignInOptions?

    How to use SignInOptions?

    Hi there.

    I am struggling trying to set SignInOptins to the Amplify.Auth.signIn method. I am trying to set it just as a simples Map<String, String> but I get "The argument type 'Map<String, String>' can't be assigned to the parameter type 'SignInOptions'.".

    How should I set a Map in signIn(options: )?

    pending-close-response-required 
    opened by brunovsiqueira 29
  • observeQuery does not return complete objects.

    observeQuery does not return complete objects.

    Description

    My team is working on a chat application where we open a observeQuery stream to observe for changes in a Room model. We have a three models, a User Model containing information about a user, Room Model which just contains an Id and last message sent. We also have a Message model which holds the string message and a User object with a belongsTo relationship. The observeQuery correctly returns the list of messages for a given room however, when we send a message the message gets saved using Amplify.Datastore.save(message) and the observeQuery returns message however the message it returns contains a User object with only an ID and all other fields are null. If we restart the screen (navigate away from the widget and back) then the observeQuery returns the full message object with the complete user object.

    The bug - Message object returned with User object with null fields.

    Categories

    • [ ] Analytics
    • [ ] API (REST)
    • [ ] API (GraphQL)
    • [ ] Auth
    • [ ] Authenticator
    • [X] DataStore
    • [ ] Storage

    Steps to Reproduce

    No response

    Screenshots

    printing in build method of widget: message after calling Datastore.save(message) 2022-08-18 10_03_18-Run - socale

    message after reloading widget 2022-08-18 10_03_33-Run - socale

    Platforms

    • [ ] iOS
    • [X] Android
    • [ ] Web
    • [ ] macOS
    • [ ] Windows
    • [ ] Linux

    Android Device/Emulator API Level

    API 32+

    Environment

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.22621.382], locale en-GB)
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    [✓] Chrome - develop for the web
    [✓] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.16)
    [✓] Android Studio (version 2021.2)
    [✓] VS Code (version 1.70.1)
    [✓] Connected device (5 available)
    [✓] HTTP Host Availability
    

    Dependencies

    Dart SDK 2.17.5
    Flutter SDK 3.0.3
    socale 1.0.0+1
    
    dependencies:
    - amplify_analytics_pinpoint 1.0.0-next.0 [amplify_analytics_pinpoint_android amplify_analytics_pinpoint_ios amplify_core aws_common flutter meta]
    - amplify_api 1.0.0-next.0+1 [amplify_api_android amplify_api_ios amplify_core amplify_flutter aws_common collection flutter meta plugin_platform_interface]
    - amplify_auth_cognito 1.0.0-next.0+4 [amplify_auth_cognito_android amplify_auth_cognito_dart amplify_auth_cognito_ios amplify_core amplify_flutter amplify_secure_storage async flutter flutter_web_plugins meta path plugin_platform_interface]
    - amplify_datastore 1.0.0-next.0 [flutter amplify_datastore_plugin_interface amplify_core plugin_platform_interface meta collection async]
    - amplify_flutter 1.0.0-next.0+1 [amplify_core amplify_datastore_plugin_interface amplify_flutter_android amplify_flutter_ios amplify_secure_storage aws_common collection flutter meta plugin_platform_interface]
    - amplify_secure_storage 0.1.0 [amplify_secure_storage_dart flutter]
    - amplify_storage_s3 1.0.0-next.0 [amplify_storage_s3_android amplify_storage_s3_ios amplify_core aws_common flutter meta plugin_platform_interface]
    - animations 2.0.3 [flutter]
    - aws_common 0.2.2 [async collection http logging meta stream_transform uuid]
    - aws_signature_v4 0.2.1 [async aws_common collection convert crypto http json_annotation meta path]
    - cupertino_icons 1.0.5
    - encrypt 5.0.1 [args asn1lib clock collection crypto pointycastle]
    - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
    - flutter_chat_types 3.4.5 [equatable json_annotation meta]
    - flutter_chat_ui 1.5.8 [flutter diffutil_dart equatable flutter_chat_types flutter_link_previewer flutter_parsed_text intl meta photo_view url_launcher visibility_detector]
    - flutter_dotenv 5.0.2 [flutter]
    - flutter_image_compress 1.1.1 [flutter]
    - flutter_riverpod 2.0.0-dev.9 [collection flutter meta riverpod state_notifier]
    - flutter_svg 1.1.4 [flutter meta path_drawing vector_math xml]
    - get 4.6.5 [flutter]
    - get_it 7.2.0 [async collection]
    - google_fonts 3.0.1 [flutter http path_provider crypto]
    - hive 2.2.3 [meta crypto]
    - hive_flutter 1.1.0 [flutter hive path_provider path]
    - image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
    - injectable 1.5.3 [get_it]
    - 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]
    - pin_code_fields 7.4.0 [flutter]
    - provider 6.0.3 [collection flutter nested]
    
    transitive dependencies:
    - amplify_analytics_pinpoint_android 1.0.0-next.0 [flutter]
    - amplify_analytics_pinpoint_ios 1.0.0-next.0 [flutter]
    - amplify_api_android 1.0.0-next.0 [flutter]
    - amplify_api_ios 1.0.0-next.0 [amplify_core flutter]
    - amplify_auth_cognito_android 1.0.0-next.0+1 [flutter]
    - amplify_auth_cognito_dart 0.1.5 [amplify_core amplify_secure_storage_dart async aws_common aws_signature_v4 built_collection built_value collection convert crypto fixnum http intl js json_annotation meta oauth2 path smithy smithy_aws stream_transform uuid worker_bee]
    - amplify_auth_cognito_ios 1.0.0-next.0+1 [amplify_core flutter]
    - amplify_core 1.0.0-next.0 [async aws_common aws_signature_v4 collection http intl json_annotation logging meta uuid]
    - amplify_datastore_plugin_interface 1.0.0-next.0 [amplify_core collection flutter meta]
    - amplify_flutter_android 1.0.0-next.0 [flutter]
    - amplify_flutter_ios 1.0.0-next.0 [amplify_core flutter]
    - amplify_secure_storage_dart 0.1.0 [aws_common built_collection built_value ffi js meta win32 worker_bee]
    - amplify_storage_s3_android 1.0.0-next.0 [flutter]
    - amplify_storage_s3_ios 1.0.0-next.0 [flutter]
    - args 2.3.1
    - asn1lib 1.1.0
    - async 2.8.2 [collection meta]
    - built_collection 5.1.1
    - built_value 8.4.0 [built_collection collection fixnum meta]
    - characters 1.2.0
    - charcode 1.3.1
    - clock 1.1.0
    - collection 1.16.0
    - convert 3.0.2 [typed_data]
    - crclib 3.0.0 [meta tuple]
    - cross_file 0.3.3+1 [js meta]
    - crypto 3.0.2 [typed_data]
    - csslib 0.17.2 [source_span]
    - diffutil_dart 3.0.0
    - equatable 2.0.3 [collection meta]
    - ffi 2.0.1
    - file 6.1.3 [meta path]
    - fixnum 1.0.1
    - flutter_link_previewer 2.6.6 [flutter flutter_chat_types flutter_linkify html http linkify meta url_launcher]
    - flutter_linkify 5.0.2 [flutter linkify]
    - flutter_parsed_text 2.2.1 [flutter]
    - flutter_plugin_android_lifecycle 2.0.7 [flutter]
    - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
    - html 0.15.0 [csslib source_span]
    - http 0.13.5 [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.6.0 [meta]
    - linkify 4.1.0
    - logging 1.0.2
    - matcher 0.12.11 [stack_trace]
    - material_color_utilities 0.1.4
    - meta 1.7.0
    - nested 1.0.0 [flutter]
    - oauth2 2.0.0 [collection crypto http http_parser]
    - 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_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]
    - photo_view 0.13.0 [flutter]
    - platform 3.1.0
    - plugin_platform_interface 2.1.2 [meta]
    - pointycastle 3.6.1 [collection convert js]
    - process 4.2.4 [file path platform]
    - quiver 3.1.0 [matcher]
    - retry 3.1.0
    - riverpod 2.0.0-dev.9 [collection meta stack_trace state_notifier]
    - shelf 1.3.2 [async collection http_parser path stack_trace stream_channel]
    - sky_engine 0.0.99
    - smithy 0.1.0 [aws_common built_collection built_value collection convert crypto fixnum http http_parser intl json_annotation meta path retry shelf typed_data xml]
    - smithy_aws 0.1.1 [aws_common aws_signature_v4 built_collection built_value collection crclib http intl json_annotation meta path smithy xml]
    - source_span 1.8.2 [collection path term_glyph]
    - stack_trace 1.10.0 [path]
    - state_notifier 0.7.2+1 [meta]
    - stream_channel 2.1.0 [async]
    - stream_transform 2.0.0
    - string_scanner 1.1.0 [charcode source_span]
    - term_glyph 1.2.0
    - tuple 2.0.0 [quiver]
    - typed_data 1.3.1 [collection]
    - url_launcher 6.1.5 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
    - url_launcher_android 6.0.17 [flutter url_launcher_platform_interface]
    - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface]
    - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface]
    - url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface]
    - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface]
    - uuid 3.0.6 [crypto]
    - vector_math 2.1.2
    - visibility_detector 0.3.3 [flutter]
    - win32 2.7.0 [ffi]
    - worker_bee 0.1.0 [async aws_common built_collection built_value collection js meta path stack_trace stream_channel stream_transform]
    - xdg_directories 0.2.0+1 [meta path process]
    - xml 6.1.0 [collection meta petitparser]
    

    Device

    Pixel 5 - API 33

    OS

    Android Api 33

    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": {
                    "socale": {
                        "endpointType": "GraphQL",
                        "endpoint":  -----------------------,
                        "region":  -----------------------,
                        "authorizationType": "API_KEY",
                        "apiKey": -----------------------
                    }
                }
            }
        },
        "analytics": {
            "plugins": {
                "awsPinpointAnalyticsPlugin": {
                    "pinpointAnalytics": {
                        "appId":  ----------------------,
                        "region":  -----------------------
                    },
                    "pinpointTargeting": {
                        "region":  -----------------------
                    }
                }
            }
        },
        "auth": {
            "plugins": {
                "awsCognitoAuthPlugin": {
                    "UserAgent": "aws-amplify-cli/0.1.0",
                    "Version": "0.1.0",
                    "IdentityManager": {
                        "Default": {}
                    },
                    "AppSync": {
                        "Default": {
                            "ApiUrl":  -----------------------,
                            "Region":  -----------------------,
                            "AuthMode":  -----------------------,
                            "ApiKey":  -----------------------,
                            "ClientDatabasePrefix":  -----------------------
                        },
                        "socale_AWS_IAM": {
                            "ApiUrl":  -----------------------,
                            "Region":  -----------------------,
                            "AuthMode": "AWS_IAM",
                            "ClientDatabasePrefix":  -----------------------
                        }
                    },
                    "CredentialsProvider": {
                        "CognitoIdentity": {
                            "Default": {
                                "PoolId":  -----------------------,
                                "Region":  -----------------------
                            }
                        }
                    },
                    "CognitoUserPool": {
                        "Default": {
                            "PoolId":  -----------------------,
                            "AppClientId":  -----------------------,
                            "Region":  -----------------------
                        }
                    },
                    "GoogleSignIn": {
                        "Permissions":  -----------------------,
                        "ClientId-WebApp":  -----------------------
                    },
                    "FacebookSignIn": {
                        "AppId":  -----------------------
                        "Permissions":  -----------------------
                    },
                    "Auth": {
                        "Default": {
                            "OAuth": {
                                "WebDomain":  -----------------------,
                                "AppClientId": -----------------------,
                                "SignInRedirectURI":  -----------------------,
                                "SignOutRedirectURI":  -----------------------,
                                "Scopes": [
                                    "phone",
                                    "email",
                                    "openid",
                                    "profile",
                                    "aws.cognito.signin.user.admin"
                                ]
                            },
                            "authenticationFlowType": "USER_SRP_AUTH",
                            "socialProviders": [
                                "FACEBOOK",
                                "GOOGLE",
                                "APPLE"
                            ],
                            "usernameAttributes": [
                                "EMAIL"
                            ],
                            "signupAttributes": [
                                "EMAIL"
                            ],
                            "passwordProtectionSettings": {
                                "passwordPolicyMinLength": 8,
                                "passwordPolicyCharacters": []
                            },
                            "mfaConfiguration": "OFF",
                            "mfaTypes": [
                                "SMS"
                            ],
                            "verificationMechanisms": [
                                "EMAIL"
                            ]
                        }
                    },
                    "PinpointAnalytics": {
                        "Default": {
                            "AppId":  -----------------------,
                            "Region":  -----------------------
                        }
                    },
                    "PinpointTargeting": {
                        "Default": {
                            "Region":  -----------------------
                        }
                    },
                    "S3TransferUtility": {
                        "Default": {
                            "Bucket":  -----------------------,
                            "Region": " -----------------------
                        }
                    }
                }
            }
        },
        "storage": {
            "plugins": {
                "awsS3StoragePlugin": {
                    "bucket":  -----------------------,
                    "region":  -----------------------,
                    "defaultAccessLevel": "guest"
                }
            }
        }
    }''';
    
    pending-close-response-required DataStore not-reproducible pending-triage 
    opened by bibaswan-bhawal 28
  • UserNotConfirmedException and ResetPasswordRequest when signing in

    UserNotConfirmedException and ResetPasswordRequest when signing in

    Hi there.

    I have a question regarding the sign in method. Shouldn't UserNotConfirmedException or ResetPasswordRequest be thrown when you call the sign in method (with username and password) for an user who is in the FORCE_CHANGE_PASSWORD status at Cognito?

    I have an user who is in the FORCE_CHANGE_PASSWORD status and when I try to sign him in it throws NotAuthorizedException (what is true because user has no password set).

    When user is trying to sign in, I'd like to know if a confirmation is needed and then send user to the forgot password flow in order for the user to confirm sign up. Is it possible?

    pending-close-response-required Auth 
    opened by brunovsiqueira 28
  • A problem occurred configuring project ':amplify_auth_cognito_android'

    A problem occurred configuring project ':amplify_auth_cognito_android'

    Description

    i'm always getting this error when trying to compile

    Launching lib/main_dev.dart on Android SDK built for x86 in debug mode...
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':amplify_auth_cognito_android'.
    > this and base files have different roots: D:\projetos\condoconta\flutter-mobile-condoconta\flut_base_app_condoconta_syndic\build\amplify_auth_cognito_android and C:\Users\jheime\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\amplify_auth_cognito_android-0.5.1\android.
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 2s
    Exception: Gradle task assembleDevDebug failed with exit code 1
    Exited (sigterm)
    
    

    Categories

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

    Steps to Reproduce

    i'm always getting this error when trying to compile

    Screenshots

    Captura de tela 2022-06-06 093509

    Platforms

    • [ ] iOS
    • [X] Android

    Android Device/Emulator API Level

    API 32+

    Environment

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.0.1, on Microsoft Windows [versao 10.0.22000.708], locale pt-BR)
    [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    [√] Chrome - develop for the web
    [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.0)
    [√] Android Studio (version 2021.1)
    [√] VS Code (version 1.67.2)
    [√] Connected device (4 available)
    [√] HTTP Host Availability
    
    • No issues found!
    

    Dependencies

    amplify_flutter: 0.5.1
      amplify_auth_cognito: 0.5.1
      amplify_core: 0.5.1
      amplify_auth_cognito_android: 0.5.1
      carousel_slider: 4.1.1
      camera: 0.9.5+1
      cupertino_icons: 1.0.4
      cached_network_image: 3.2.1
      cpf_cnpj_validator: 2.0.0
      dotted_border: 2.0.0+2
      device_info_plus: 3.2.3
      email_validator: 2.0.1
      enum_to_string: 2.0.1
      flutter_modular: 5.0.2
      file_picker: 4.5.1
      flutter_mobx: 2.0.6+1
      flutter_svg: 1.0.3
      flutter_keyboard_visibility: 5.2.0
      flutter_cache_manager: 3.3.0
      flutter_spinkit: 5.1.0
      fluttertoast: 8.0.9
      flutter_udid: 2.0.0
      barcode_scanner_kit: 1.0.1
      image_picker: 0.8.5
      intl: 0.17.0
      just_the_tooltip: 0.0.11+2
      jiffy: 5.0.0
      localization: 2.1.0
      logger: 1.1.0
      mocktail: 0.3.0
      mobx: 2.0.7
      mask_text_input_formatter: 2.3.0
      easy_mask: 2.0.1
      native_pdf_view: 6.0.0+1
      notification_permissions: 0.6.1
      path_provider: 2.0.9
      package_info_plus: 1.4.2
      pin_code_fields: 7.4.0
      recase: 4.0.0
      screenshot: 1.2.3
      sticky_and_expandable_list: 1.0.3 
      share_plus: 3.0.5
      shared_preferences: 2.0.13
      shimmer: 2.0.0
      timer_count_down: 2.2.1
      uuid: 3.0.5
      url_launcher: 6.1.2
      dio: 4.0.6
      flutter_image_compress: 1.1.0
      syncfusion_flutter_pdfviewer: 20.1.56-beta
      syncfusion_flutter_pdf: 20.1.56-beta
      crypto: 3.0.1
      dropdown_search: 3.0.1
      webviewx:
    

    Device

    Pixel 3a XL API 30 (Android-x86 emulator)

    OS

    Android 11

    CLI Version

    7.6.21

    Additional Context

    No response

    pending-close-response-required Build pending-triage 
    opened by jheimes-silveira 27
  • Cannot authenticate: Auth.signIn() fails with

    Cannot authenticate: Auth.signIn() fails with "false provider" and "Error in federating the token" messages in Android simulator

    Describe the bug The Auth flow for this app is email & password sign-in / sign-up, with email only verification. When calling await Amplify.Auth.signIn(...) from an app running on the Android simulator, the user never gets signed in! Instead, you see some Java errors in the debug console (they are pasted below) and even though the call to signIn() returns an object with .isSignedIn == true and .nextStep!.signInStep == 'DONE' the user never gets to be signed in -- that's at least true in the following sense: if you call await getCurrentUser() right after the await signIn() call it throws a SignedOutException; if you call await Auth.fetchAuthSession() it returns a session whose .isSignedIn is false and if you call await Auth.fetchAuthSession(options: CognitoSessionOptions(getAWSCredentials: true)) it throws a SessionExpiredException as described in issue #441.

    [ This happens after an email-only signUp() call with email-verification, made via the call

      await Amplify.Auth.signUp(username: email, password: password);
    

    ]

    I checked that amplifyconfiguration.dart has been created correctly and that the relevant values for endpoints of the user pool and identity pool and identity-pool Id there match those on the AWS console - they all do. Here is the output of the Android simulator when running right after the call to Amplify.Auth.signIn():

    D/AWSMobileClient(13077): _federatedSignIn: Putting provider and token in store
    D/AWSMobileClient(13077): Inspecting user state details
    D/AWSMobileClient(13077): hasFederatedToken: false provider: cognito-idp.us-east-1.amazonaws.com/us-east-1_xxxxxxxxx
    W/AWSMobileClient(13077): Failed to federate tokens during sign-in
    W/AWSMobileClient(13077): java.lang.RuntimeException: Error in federating the token.
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient$10.run(AWSMobileClient.java:1826)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.internal.InternalCallback.await(InternalCallback.java:115)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient.federatedSignInWithoutAssigningState(AWSMobileClient.java:1754)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient$6$1.onSuccess(AWSMobileClient.java:1243)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getSession(CognitoUser.java:1023)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient$6.run(AWSMobileClient.java:1228)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
    W/AWSMobileClient(13077): 	at java.lang.Thread.run(Thread.java:764)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCachingCredentialsProvider.refresh(CognitoCachingCredentialsProvider.java:511)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCachingCredentialsProvider.getIdentityId(CognitoCachingCredentialsProvider.java:453)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCredentialsProvider.populateCredentialsWithCognito(CognitoCredentialsProvider.java:785)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCredentialsProvider.startSession(CognitoCredentialsProvider.java:703)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCredentialsProvider.refresh(CognitoCredentialsProvider.java:640)
    W/AWSMobileClient(13077): 	at com.amazonaws.auth.CognitoCachingCredentialsProvider.refresh(CognitoCachingCredentialsProvider.java:511)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient.federateWithCognitoIdentity(AWSMobileClient.java:1857)
    W/AWSMobileClient(13077): 	at com.amazonaws.mobile.client.AWSMobileClient$10.run(AWSMobileClient.java:1813)
    W/AWSMobileClient(13077): 	... 7 more
    

    NOTE: This bug is showing up in code that used to work - the same code did not produce the bug in the past. Either something is wrong with the network infrastructure or perhaps it is related to an older version of the Amplify Flutter library - not sure, but the code definitely worked before with an older version of the Amplify Flutter libraries.

    A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Set up an Amplify Auth via Cognito user pools for email + password login and for email-only verification, via
        await Amplify.Auth.signUp(username: email, password: password);
      
    2. sign in with email & password via
        await Amplify.Auth.signIn(email: email, password: password)
      
    3. call await Amplify.Auth.getCurrentUser() immediately after that and it will throw a SignedOutException also you'll see the above output in your debug console

    Expected behavior Expected getCurrentUser() to return a user object that allows us to get the sub and the email for that user.

    Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply): Only tested in Android simulator.

    Output of flutter doctor -v
    [✓] Flutter (Channel stable, 2.8.0, on Debian GNU/Linux 10 (buster) 4.19.0-18-amd64, locale en_US.UTF-8)
      • Flutter version 2.8.0 at /usr/local/src/flutter/flutter
      • Upstream repository https://github.com/flutter/flutter.git
      • Framework revision cf44000065 (3 days ago), 2021-12-08 14:06:50 -0800
      • Engine revision 40a99c5951
      • Dart version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
      • Android SDK at /home/dtal/Android/Sdk
      • Platform android-31, build-tools 31.0.0
      • Java binary at: /usr/local/src/android-studio/android-studio/jre/bin/java
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
      • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
      • Chrome at google-chrome
    
    [✓] Linux toolchain - develop for Linux desktop
      • clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
      • cmake version 3.13.4
      • ninja version 1.8.2
      • pkg-config version 0.29
    
    [✓] Android Studio (version 2020.3)
      • Android Studio at /usr/local/src/android-studio/android-studio
      • Flutter plugin version 62.0.1
      • Dart plugin version 203.8452
      • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [✓] VS Code (version 1.63.0)
      • VS Code at /usr/share/code
      • Flutter extension version 3.29.0
    
    [✓] Connected device (3 available)
      • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 8.0.0 (API 26) (emulator)
      • Linux (desktop)                    • linux         • linux-x64      • Debian GNU/Linux 10 (buster) 4.19.0-18-amd64
      • Chrome (web)                       • chrome        • web-javascript • Google Chrome 96.0.4664.93
    
    • No issues found!
    
    Dependencies (pubspec.lock)
    Paste the contents of your "pubspec.lock" file here
    
    
    # Generated by pub
    # See https://dart.dev/tools/pub/glossary#lockfile
    packages:
    _fe_analyzer_shared:
      dependency: transitive
      description:
        name: _fe_analyzer_shared
        url: "https://pub.dartlang.org"
      source: hosted
      version: "31.0.0"
    amplify_analytics_plugin_interface:
      dependency: transitive
      description:
        name: amplify_analytics_plugin_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_api:
      dependency: "direct main"
      description:
        name: amplify_api
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_api_plugin_interface:
      dependency: transitive
      description:
        name: amplify_api_plugin_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_auth_cognito:
      dependency: "direct main"
      description:
        name: amplify_auth_cognito
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_auth_plugin_interface:
      dependency: transitive
      description:
        name: amplify_auth_plugin_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_core:
      dependency: transitive
      description:
        name: amplify_core
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_datastore_plugin_interface:
      dependency: transitive
      description:
        name: amplify_datastore_plugin_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_flutter:
      dependency: "direct main"
      description:
        name: amplify_flutter
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    amplify_storage_plugin_interface:
      dependency: transitive
      description:
        name: amplify_storage_plugin_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.10"
    analyzer:
      dependency: transitive
      description:
        name: analyzer
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.8.0"
    args:
      dependency: transitive
      description:
        name: args
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.3.0"
    async:
      dependency: transitive
      description:
        name: async
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.8.2"
    boolean_selector:
      dependency: transitive
      description:
        name: boolean_selector
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    build:
      dependency: transitive
      description:
        name: build
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.1"
    build_config:
      dependency: transitive
      description:
        name: build_config
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.0"
    build_daemon:
      dependency: transitive
      description:
        name: build_daemon
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.0.1"
    build_resolvers:
      dependency: transitive
      description:
        name: build_resolvers
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.5"
    build_runner:
      dependency: "direct dev"
      description:
        name: build_runner
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.5"
    build_runner_core:
      dependency: transitive
      description:
        name: build_runner_core
        url: "https://pub.dartlang.org"
      source: hosted
      version: "7.2.2"
    built_collection:
      dependency: transitive
      description:
        name: built_collection
        url: "https://pub.dartlang.org"
      source: hosted
      version: "5.1.1"
    built_value:
      dependency: transitive
      description:
        name: built_value
        url: "https://pub.dartlang.org"
      source: hosted
      version: "8.1.3"
    characters:
      dependency: transitive
      description:
        name: characters
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    charcode:
      dependency: transitive
      description:
        name: charcode
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.3.1"
    checked_yaml:
      dependency: transitive
      description:
        name: checked_yaml
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.1"
    cli_util:
      dependency: transitive
      description:
        name: cli_util
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.3.5"
    clock:
      dependency: transitive
      description:
        name: clock
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.1.0"
    code_builder:
      dependency: transitive
      description:
        name: code_builder
        url: "https://pub.dartlang.org"
      source: hosted
      version: "4.1.0"
    collection:
      dependency: transitive
      description:
        name: collection
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.15.0"
    convert:
      dependency: transitive
      description:
        name: convert
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.0.1"
    crypto:
      dependency: transitive
      description:
        name: crypto
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.0.1"
    cupertino_icons:
      dependency: "direct main"
      description:
        name: cupertino_icons
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.4"
    dart_style:
      dependency: transitive
      description:
        name: dart_style
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.2.0"
    date_time_format:
      dependency: transitive
      description:
        name: date_time_format
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.1"
    fake_async:
      dependency: transitive
      description:
        name: fake_async
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    ffi:
      dependency: transitive
      description:
        name: ffi
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.1.2"
    file:
      dependency: transitive
      description:
        name: file
        url: "https://pub.dartlang.org"
      source: hosted
      version: "6.1.2"
    fixnum:
      dependency: transitive
      description:
        name: fixnum
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.0"
    flutter:
      dependency: "direct main"
      description: flutter
      source: sdk
      version: "0.0.0"
    flutter_hooks:
      dependency: "direct main"
      description:
        name: flutter_hooks
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.18.1"
    flutter_lints:
      dependency: "direct dev"
      description:
        name: flutter_lints
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.4"
    flutter_riverpod:
      dependency: transitive
      description:
        name: flutter_riverpod
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.2"
    flutter_test:
      dependency: "direct dev"
      description: flutter
      source: sdk
      version: "0.0.0"
    frontend_server_client:
      dependency: transitive
      description:
        name: frontend_server_client
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.2"
    glob:
      dependency: transitive
      description:
        name: glob
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.2"
    google_fonts:
      dependency: "direct main"
      description:
        name: google_fonts
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    graphs:
      dependency: transitive
      description:
        name: graphs
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    hooks_riverpod:
      dependency: "direct main"
      description:
        name: hooks_riverpod
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.2"
    http:
      dependency: transitive
      description:
        name: http
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.13.4"
    http_multi_server:
      dependency: transitive
      description:
        name: http_multi_server
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.0.1"
    http_parser:
      dependency: transitive
      description:
        name: http_parser
        url: "https://pub.dartlang.org"
      source: hosted
      version: "4.0.0"
    io:
      dependency: transitive
      description:
        name: io
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.3"
    js:
      dependency: transitive
      description:
        name: js
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.6.3"
    json_annotation:
      dependency: transitive
      description:
        name: json_annotation
        url: "https://pub.dartlang.org"
      source: hosted
      version: "4.4.0"
    lints:
      dependency: transitive
      description:
        name: lints
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.1"
    logging:
      dependency: transitive
      description:
        name: logging
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.2"
    matcher:
      dependency: transitive
      description:
        name: matcher
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.12.11"
    meta:
      dependency: transitive
      description:
        name: meta
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.7.0"
    mime:
      dependency: transitive
      description:
        name: mime
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.1"
    mockito:
      dependency: "direct dev"
      description:
        name: mockito
        url: "https://pub.dartlang.org"
      source: hosted
      version: "5.0.16"
    network_image_mock:
      dependency: "direct dev"
      description:
        name: network_image_mock
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.1"
    package_config:
      dependency: transitive
      description:
        name: package_config
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.2"
    path:
      dependency: transitive
      description:
        name: path
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.8.0"
    path_provider:
      dependency: transitive
      description:
        name: path_provider
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.8"
    path_provider_android:
      dependency: transitive
      description:
        name: path_provider_android
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.9"
    path_provider_ios:
      dependency: transitive
      description:
        name: path_provider_ios
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.7"
    path_provider_linux:
      dependency: transitive
      description:
        name: path_provider_linux
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.4"
    path_provider_macos:
      dependency: transitive
      description:
        name: path_provider_macos
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.4"
    path_provider_platform_interface:
      dependency: transitive
      description:
        name: path_provider_platform_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.1"
    path_provider_windows:
      dependency: transitive
      description:
        name: path_provider_windows
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.4"
    platform:
      dependency: transitive
      description:
        name: platform
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.1.0"
    plugin_platform_interface:
      dependency: transitive
      description:
        name: plugin_platform_interface
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.2"
    pool:
      dependency: transitive
      description:
        name: pool
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.5.0"
    process:
      dependency: transitive
      description:
        name: process
        url: "https://pub.dartlang.org"
      source: hosted
      version: "4.2.4"
    pub_semver:
      dependency: transitive
      description:
        name: pub_semver
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    pubspec_parse:
      dependency: transitive
      description:
        name: pubspec_parse
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    riverpod:
      dependency: transitive
      description:
        name: riverpod
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.2"
    shelf:
      dependency: transitive
      description:
        name: shelf
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    shelf_web_socket:
      dependency: transitive
      description:
        name: shelf_web_socket
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.1"
    sky_engine:
      dependency: transitive
      description: flutter
      source: sdk
      version: "0.0.99"
    source_gen:
      dependency: transitive
      description:
        name: source_gen
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    source_span:
      dependency: transitive
      description:
        name: source_span
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.8.1"
    stack_trace:
      dependency: transitive
      description:
        name: stack_trace
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.10.0"
    state_notifier:
      dependency: transitive
      description:
        name: state_notifier
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.7.1"
    stream_channel:
      dependency: transitive
      description:
        name: stream_channel
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    stream_transform:
      dependency: transitive
      description:
        name: stream_transform
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.0.0"
    string_scanner:
      dependency: transitive
      description:
        name: string_scanner
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.1.0"
    term_glyph:
      dependency: transitive
      description:
        name: term_glyph
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.2.0"
    test_api:
      dependency: transitive
      description:
        name: test_api
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.4.3"
    timing:
      dependency: transitive
      description:
        name: timing
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.0"
    typed_data:
      dependency: transitive
      description:
        name: typed_data
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.3.0"
    uuid:
      dependency: transitive
      description:
        name: uuid
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.0.5"
    vector_math:
      dependency: transitive
      description:
        name: vector_math
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.1"
    watcher:
      dependency: transitive
      description:
        name: watcher
        url: "https://pub.dartlang.org"
      source: hosted
      version: "1.0.1"
    web_socket_channel:
      dependency: transitive
      description:
        name: web_socket_channel
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.1.0"
    win32:
      dependency: transitive
      description:
        name: win32
        url: "https://pub.dartlang.org"
      source: hosted
      version: "2.3.1"
    xdg_directories:
      dependency: transitive
      description:
        name: xdg_directories
        url: "https://pub.dartlang.org"
      source: hosted
      version: "0.2.0"
    yaml:
      dependency: transitive
      description:
        name: yaml
        url: "https://pub.dartlang.org"
      source: hosted
      version: "3.1.0"
    sdks:
    dart: ">=2.14.0 <3.0.0"
    flutter: ">=2.5.0"
    
    

    Smartphone (please complete the following information):

    • Android Simulator only - Android v8.0.0

    Additional context This problem did not exist before - I believe it was the same code but an older version of the Amplify libraries.

    Auth to-be-reproduced 
    opened by dorontal 27
  • Retrieve data from Amplify Cloud back to DataStore

    Retrieve data from Amplify Cloud back to DataStore

    I am new to Amplify datastore and decided to use Amplify Datastore with flutter app to provide offline mode feature to the users. I successfully implemented my project with Datastore but I would like to clear the local storage when the user logs out. And if logs back, I want user's data to be there but it seems like datastore sync data from local to cloud out of the box but do not sync cloud to local storage back since I can't see any records (After login back or after reinstalling).

    So are we required to retrieve the data from dynamoDB using GraphQL APIs and then save it to the local datastore or is there any out-of-the-box function provided by Amplify to retrieve data from the cloud? What's the ideal approach?

    Logs

    I/amplify:aws-datastore(22312): Orchestrator lock acquired.
    I/amplify:aws-datastore(22312): Orchestrator lock released.
    E/amplify:aws-datastore(22312): Failure encountered while attempting to start API sync.
    E/amplify:aws-datastore(22312): DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}
    E/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.startSubscriptions(SubscriptionProcessor.java:154)
    E/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$Orchestrator(Orchestrator.java:309)
    E/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.-$$Lambda$Orchestrator$to6jsrpqq5TGk-8kfWyEK_7WfwQ.subscribe(Unknown Source:2)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
    E/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
    E/amplify:aws-datastore(22312):         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    E/amplify:aws-datastore(22312):         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    E/amplify:aws-datastore(22312):         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    E/amplify:aws-datastore(22312):         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    E/amplify:aws-datastore(22312):         at java.lang.Thread.run(Thread.java:923)
    W/amplify:aws-datastore(22312): API sync failed - transitioning to LOCAL_ONLY.
    W/amplify:aws-datastore(22312): DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}
    W/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.startSubscriptions(SubscriptionProcessor.java:154)
    W/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$Orchestrator(Orchestrator.java:309)
    W/amplify:aws-datastore(22312):         at com.amplifyframework.datastore.syncengine.-$$Lambda$Orchestrator$to6jsrpqq5TGk-8kfWyEK_7WfwQ.subscribe(Unknown Source:2)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
    W/amplify:aws-datastore(22312):         at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
    W/amplify:aws-datastore(22312):         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    W/amplify:aws-datastore(22312):         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    W/amplify:aws-datastore(22312):         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    W/amplify:aws-datastore(22312):         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    W/amplify:aws-datastore(22312):         at java.lang.Thread.run(Thread.java:923)
    I/amplify:aws-datastore(22312): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
    I/amplify:aws-datastore(22312): Setting currentState to LOCAL_ONLY
    I/amplify:aws-datastore(22312): Stopping subscription processor.
    I/amplify:aws-api(22312): No more active subscriptions. Closing web socket.
    I/amplify:aws-datastore(22312): Stopped subscription processor.
    

    I also notice after a few logins and logouts it somehow fetched the data from the cloud and I was able to see the records on my application. Not sure what's going on :/

    To Reproduce Steps to reproduce the behavior:

    1. Login and generate some data
    2. Clear datastore and logout
    3. uninstall the app and run the application again

    Expected behavior After signing and querying Datastore, the datastore should sync with the cloud or provide Datastore functions to retrieve data from the cloud and the user should see the data he/she has created before.

    Platform iOS. Didn't try in Android.

    Output of flutter doctor -v
    [✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-arm, locale
      en-IN)
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    [✓] Xcode - develop for iOS and macOS
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 4.1)
    [✓] VS Code (version 1.54.3)
    [✓] Connected device (1 available)
    
    • No issues found!```
    </details>
    
    
    
    **Smartphone (please complete the following information):**
    - Device: iPhone 12 Pro Max
    - OS: iOS 14.5
    
    
    Question DataStore 
    opened by gauravdangi 27
  • chore(deps): bump graphql from 5.1.1 to 5.1.2 in /packages/amplify_test

    chore(deps): bump graphql from 5.1.1 to 5.1.2 in /packages/amplify_test

    Bumps graphql from 5.1.1 to 5.1.2.

    Commits
    • 409447d docs: generate the changelog for the next tag release
    • 01e12fd Merge pull request #1267 from zino-hofmann/macros/connectivity_plus
    • facc95f docs: bump the packages version
    • 0c40ccd Merge pull request #1264 from zino-hofmann/macros/connectivity_plus
    • a92a3e2 fix(graphql_flutter): increase connectivity_plus version to v3
    • 1e9581e feat(graphql): add raw to exceptions on QueryResult
    • 32f95c5 Merge pull request #1234 from tauu/null-access-fix
    • 344e611 fix(graphql): fixing the dart analyzer error
    • a2d068b Merge pull request #1240 from apackin/setForPollingQueries
    • f8ee62a prepare release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Not Authorized to access createStashItem on type StashItem

    Not Authorized to access createStashItem on type StashItem

    I am getting an error when trying to create a record using graphql. Android 33 and Web. Using AppSync console create is successful.

    dependencies: flutter: sdk: flutter

    amplify_flutter: ^1.0.0-next.2 amplify_authenticator: ^1.0.0-next.1+3 amplify_auth_cognito: ^1.0.0-next.2+1 amplify_api: ^1.0.0-next.2+1 amplify_datastore: ^1.0.0-next.2

    errors: [GraphQLResponseError{ "message": "Not Authorized to access createStashItem on type StashItem", "locations": [ { "line": 1, "column": 102 } ], "path": [ "createStashItem" ] }]

    model type StashItem @aws_cognito_user_pools @model(timestamps:{createdAt: "createdOn", updatedAt: "updatedOn"}) @auth(rules: [ {allow: owner, ownerField: "userid",operations: [create, update, delete, read]}, { allow: public, operations: [create, read]}, ]) { id: ID! @primaryKey userid: String name: String }

    code calling create Future<void> createStashI(name) async { try { final stash = StashItem(name: name); final request = ModelMutations.create(stash, authorizationMode: APIAuthorizationType.userPools); debugPrint("request: $request"); final response = await Amplify.API.mutate(request: request).response; debugPrint("request: $response"); final createdStashItem = response.data; if (createdStashItem == null) { safePrint('errors: ${response.errors}'); return; } safePrint('Mutation result: ${createdStashItem.name}'); } on ApiException catch (e) { safePrint('Mutation failed: $e'); } }

    Amplify configure code

    Future<void> _configureAmplify() async { if (!Amplify.isConfigured) { try { await Amplify.addPlugins([ AmplifyAuthCognito( credentialStorage: AmplifySecureStorage( config: AmplifySecureStorageConfig( scope: 'api', macOSOptions: MacOSSecureStorageOptions(useDataProtection: false), ), ), ), AmplifyAPI(modelProvider: ModelProvider.instance) ]); await Amplify.configure(amplifyconfig); } on Exception catch (e) { safePrint('An error occurred while configuring Amplify: $e'); } } }

    GraphQL API pending-triage 
    opened by tmageebtr 6
  • Datastore clear not all tables

    Datastore clear not all tables

    We have user specific data, and data that are for all users the same. We want to use Datastore to synchronize them from the backend, the app does not change data. If the user log out, we need to delete the user spesific data, because of the General Data Protection Regulation from the EU. But because of offline functionality, also after the logout and, we need to delete only the user data, the general data for all useres must still be availible. Is there a way to delete the data only locally and synchronize it again after a new login, or reevaluate the filter and delete not includetet data? If this is currently not supported, is it possible to implement it?

    Question DataStore pending-response 
    opened by ruossn 2
  • Unauthorized  exception when trying to subscribe to DDB streams while using DataStore authorization

    Unauthorized exception when trying to subscribe to DDB streams while using DataStore authorization

    Description

    My usecase is to subscribe to a model and process the data when Lambda Function creates a new record. When I apply DataStore authorization, I don't get notification for the records I'm listening to.

    ? Select a setting to edit Authorization modes
    ? Choose the default authorization type for the API Amazon Cognito User Pool
    Use a Cognito user pool configured as a part of this project.
    ? Configure additional auth types? Yes
    ? Choose the additional authorization types you want to configure for the API API key
    API key configuration
    ✔ Enter a description for the API key: · Public API
    ✔ After how many days from now the API key should expire (1-365): · 365
    

    Model

    type User @model @auth(rules: [
      { allow: private, provider: iam, operations: [read]},
      { allow: owner }
    ]) {
      id: ID!
      user_id: String! @index(name: "byUserId")
      owner: String @auth(rules: [{ allow: owner, operations: [read, delete] }])
    }
    

    Subscription

    When the app starts, it subscribes to listen to DDB changes.

      observeUser({required String userId}) {
        final itemStream = ddbRepo.observeUser(userId);
          final subscription = itemStream.listen((event) async {
            // logic
          });
        }
      } 
    

    Repository

      Stream<QuerySnapshot<Delete>> observeDelete(String userId) {
        return Amplify.DataStore.observeQuery(User.classType, where: User.USER_ID.eq(userId));
      }
    

    Lambda Function

    I'm creating new User record from Lambda function following this guide. https://docs.amplify.aws/cli/function/#iam-authorization


    After reading https://docs.amplify.aws/cli/graphql/authorization-rules/#field-level-authorization-rules, I tried something like this.

    type User @model @auth(rules: [
      { allow: private, provider: iam, operations: [read]},
      { allow: owner }
    ]) {
      id: ID! @auth(rules: [{ allow: public, operations: [read] }]) 
      user_id: String! @auth(rules: [{ allow: public, operations: [read] }]) @index(name: "byUserId")
      owner: String @auth(rules: [{ allow: owner, operations: [read, delete] }])
    }
    

    But it gives me following error.

    When using field-level authorization rules you need to add rules to all of the model's required fields with at least read permissions. Found model "User" with required fields ["id","user_id"] missing field-level authorization rules.

    When the app starts, I do see lots of unauthorized errors.

    [IncomingAsyncSubscriptionEventToAnyModelMapper] Received subscription: PassthroughSubject
    ConnectionProviderError.jsonParse; identifier=F948F50D-ECB7-49CB-B022-A6885CEEB31D; additionalInfo=Optional(["errors": AppSyncRealTimeClient.AppSyncJSONValue.array([AppSyncRealTimeClient.AppSyncJSONValue.object(["message": AppSyncRealTimeClient.AppSyncJSONValue.string("Not Authorized to access onDeleteMessage on type Subscription"), "errorType": AppSyncRealTimeClient.AppSyncJSONValue.string("Unauthorized")])])])
    

    Categories

    • [ ] Analytics
    • [X] API (REST)
    • [ ] API (GraphQL)
    • [X] Auth
    • [ ] Authenticator
    • [X] DataStore
    • [ ] Storage

    Steps to Reproduce

    Test Scenario

    1. When the app starts, it calls observeUser with userId 12345.
    2. Trigger Lambda function to create a new User record with userId 12345.

    Expected behavior

    User model allows read operation for authenticated users. So my expectation is that when Lambda function creates a record with userId the app is listening to, the app should be notified.

    Actual behavior

    The app doesn't get notified when Lambda creates a record with userId the app is listening to.

    Screenshots

    No response

    Platforms

    • [X] iOS
    • [X] Android
    • [ ] Web
    • [ ] macOS
    • [ ] Windows
    • [ ] Linux

    Android Device/Emulator API Level

    No response

    Environment

    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.3.10, on macOS 13.0 22A380 darwin-arm, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    [✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 2021.3)
    [✓] VS Code (version 1.74.0)
    [✓] Connected device (3 available)
    [✓] HTTP Host Availability
    

    Dependencies

    Dart SDK 2.18.6
    Flutter SDK 3.3.10
    chummy 1.0.0+1
    
    dependencies:
    - amplify_analytics_pinpoint 0.6.10 [amplify_analytics_pinpoint_android amplify_analytics_pinpoint_ios amplify_core aws_common flutter meta]
    - amplify_api 0.6.10 [amplify_api_android amplify_api_ios amplify_core amplify_flutter aws_common collection flutter meta plugin_platform_interface]
    - amplify_auth_cognito 0.6.10 [amplify_auth_cognito_android amplify_auth_cognito_ios amplify_core aws_common collection flutter meta plugin_platform_interface]
    - amplify_authenticator 0.2.4 [amplify_auth_cognito amplify_core amplify_flutter async aws_common collection flutter flutter_localizations intl stream_transform]
    - amplify_datastore 0.6.10 [flutter amplify_datastore_plugin_interface amplify_core plugin_platform_interface meta collection async]
    - amplify_flutter 0.6.10 [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.10 [amplify_storage_s3_android amplify_storage_s3_ios amplify_core aws_common flutter meta plugin_platform_interface path_provider path]
    - cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
    - connectivity_plus 3.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm]
    - cupertino_icons 1.0.5
    - dotted_border 2.0.0+2 [flutter path_drawing]
    - dropdown_button2 1.8.5 [flutter]
    - email_validator 2.1.17
    - firebase_core 2.3.0 [firebase_core_platform_interface firebase_core_web flutter meta]
    - firebase_messaging 14.1.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
    - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
    - flutter_app_badger 1.5.0 [flutter]
    - flutter_bloc 8.1.1 [flutter bloc provider]
    - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
    - flutter_image_compress 1.1.3 [flutter]
    - flutter_local_notifications 12.0.4 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
    - flutter_native_splash 2.2.15 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml]
    - flutter_slidable 2.0.0 [flutter]
    - geocoding 2.0.5 [flutter geocoding_platform_interface]
    - geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
    - google_maps_flutter 2.2.1 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface]
    - google_mobile_ads 2.3.0 [meta flutter visibility_detector]
    - google_place 0.4.7 [http]
    - image_picker 0.8.6 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
    - intl 0.17.0 [clock path]
    - material_design_icons_flutter 6.0.7096 [flutter]
    - 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]
    - percent_indicator 4.2.2 [flutter]
    - permission_handler 10.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface]
    - quiver 3.1.0 [matcher]
    - social_login_buttons 1.0.7 [flutter]
    - url_launcher 6.1.7 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows]
    
    transitive dependencies:
    - _flutterfire_internals 1.0.9 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
    - amplify_analytics_pinpoint_android 0.6.10 [flutter]
    - amplify_analytics_pinpoint_ios 0.6.10 [flutter]
    - amplify_api_android 0.6.10 [flutter]
    - amplify_api_ios 0.6.10 [amplify_core flutter]
    - amplify_auth_cognito_android 0.6.10 [flutter]
    - amplify_auth_cognito_ios 0.6.10 [amplify_core flutter]
    - amplify_core 0.6.10 [aws_common collection flutter intl json_annotation meta plugin_platform_interface uuid]
    - amplify_datastore_plugin_interface 0.6.10 [amplify_core collection flutter meta]
    - amplify_flutter_android 0.6.10 [flutter]
    - amplify_flutter_ios 0.6.10 [amplify_core flutter]
    - amplify_storage_s3_android 0.6.10 [flutter]
    - amplify_storage_s3_ios 0.6.10 [flutter]
    - archive 3.3.4 [crypto path pointycastle]
    - args 2.3.1
    - async 2.9.0 [collection meta]
    - aws_common 0.1.1 [async collection http meta stream_transform uuid]
    - bloc 8.1.0 [meta]
    - boolean_selector 2.1.0 [source_span string_scanner]
    - cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager]
    - cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface]
    - characters 1.2.1
    - clock 1.1.1
    - cloud_firestore_platform_interface 5.9.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
    - cloud_firestore_web 3.1.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
    - collection 1.16.0
    - connectivity_plus_platform_interface 1.2.3 [flutter meta plugin_platform_interface]
    - convert 3.1.1 [typed_data]
    - cross_file 0.3.3+2 [js meta]
    - crypto 3.0.2 [typed_data]
    - csslib 0.17.2 [source_span]
    - dbus 0.7.8 [args ffi meta xml]
    - fake_async 1.3.1 [clock collection]
    - ffi 2.0.1
    - file 6.1.4 [meta path]
    - firebase_core_platform_interface 4.5.2 [collection flutter flutter_test meta plugin_platform_interface]
    - firebase_core_web 2.0.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
    - firebase_messaging_platform_interface 4.2.7 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
    - firebase_messaging_web 3.2.7 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
    - flutter_blurhash 0.7.0 [flutter]
    - flutter_local_notifications_linux 2.0.0 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories]
    - flutter_local_notifications_platform_interface 6.0.0 [flutter plugin_platform_interface]
    - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
    - flutter_plugin_android_lifecycle 2.0.7 [flutter]
    - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]
    - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
    - geocoding_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
    - geolocator_android 4.1.4 [flutter geolocator_platform_interface]
    - geolocator_apple 2.2.2 [flutter geolocator_platform_interface]
    - geolocator_platform_interface 4.0.6 [flutter plugin_platform_interface vector_math meta]
    - geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface]
    - geolocator_windows 0.1.1 [flutter geolocator_platform_interface]
    - google_maps_flutter_android 2.3.2 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform]
    - google_maps_flutter_ios 2.1.12 [flutter google_maps_flutter_platform_interface stream_transform]
    - google_maps_flutter_platform_interface 2.2.4 [collection flutter plugin_platform_interface stream_transform]
    - html 0.15.1 [csslib source_span]
    - http 0.13.5 [async http_parser meta path]
    - http_parser 4.0.1 [collection source_span string_scanner typed_data]
    - image 3.2.2 [archive meta xml]
    - image_picker_android 0.8.5+3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
    - image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface]
    - image_picker_ios 0.8.6+1 [flutter image_picker_platform_interface]
    - image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface]
    - js 0.6.4
    - json_annotation 4.7.0 [meta]
    - matcher 0.12.12 [stack_trace]
    - material_color_utilities 0.1.5
    - meta 1.8.0
    - nested 1.0.0 [flutter]
    - nm 0.5.0 [dbus]
    - octo_image 1.0.2 [flutter flutter_blurhash]
    - path 1.8.2
    - path_drawing 1.0.1 [vector_math meta path_parsing flutter]
    - path_parsing 1.0.1 [vector_math meta]
    - path_provider_android 2.0.20 [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.5 [flutter platform plugin_platform_interface]
    - path_provider_windows 2.1.3 [ffi flutter path path_provider_platform_interface win32]
    - pedantic 1.11.1
    - permission_handler_android 10.2.0 [flutter permission_handler_platform_interface]
    - permission_handler_apple 9.0.7 [flutter permission_handler_platform_interface]
    - permission_handler_platform_interface 3.9.0 [flutter meta plugin_platform_interface]
    - permission_handler_windows 0.1.2 [flutter permission_handler_platform_interface]
    - petitparser 5.1.0 [meta]
    - platform 3.1.0
    - plugin_platform_interface 2.1.3 [meta]
    - pointycastle 3.6.2 [collection convert js]
    - process 4.2.4 [file path platform]
    - provider 6.0.3 [collection flutter nested]
    - rxdart 0.27.5
    - sky_engine 0.0.99
    - source_span 1.9.0 [collection path term_glyph]
    - sqflite 2.1.0+1 [flutter sqflite_common path]
    - sqflite_common 2.3.0 [synchronized path meta]
    - stack_trace 1.10.0 [path]
    - stream_channel 2.1.0 [async]
    - stream_transform 2.0.0
    - string_scanner 1.1.1 [source_span]
    - synchronized 3.0.0+3
    - term_glyph 1.2.1
    - test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
    - timezone 0.9.0 [path]
    - typed_data 1.3.1 [collection]
    - universal_io 2.0.4 [collection crypto meta typed_data]
    - url_launcher_android 6.0.22 [flutter url_launcher_platform_interface]
    - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface]
    - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface]
    - url_launcher_platform_interface 2.1.1 [flutter plugin_platform_interface]
    - url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface]
    - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface]
    - uuid 3.0.6 [crypto]
    - vector_math 2.1.2
    - visibility_detector 0.3.3 [flutter]
    - win32 3.0.1 [ffi]
    - xdg_directories 0.2.0+2 [meta path process]
    - xml 6.1.0 [collection meta petitparser]
    - yaml 3.1.1 [collection source_span string_scanner]
    

    Device

    iPhone 12

    OS

    iOS 16.1.2

    Deployment Method

    Amplify CLI

    CLI Version

    10.5.2

    Additional Context

    No response

    Amplify Config

    NA

    Question DataStore pending-response 
    opened by skim037 2
Releases(v1.0.0-next.1)
  • v1.0.0-next.1(Nov 16, 2022)

    This release includes preview versions of the API, Analytics, and Storage categories written in Dart with support for Web, Desktop, and Mobile platforms!

    See our docs for guides on how to migrate to these new versions.

    Breaking Changes

    • chore(api,core): change API types (#2148)
    • chore(storage): migrate interface and setup basic packages

    Features

    • feat(api): GraphQL Custom Request Headers (#1938)
    • feat(api): Subscription Reconnection (#2074)
    • feat(api): authorizationMode property for GraphQLRequest (#2143)
    • feat(core): add AWSFile cross platform file abstraction
    • feat(storage): add custom prefix resolver support
    • feat(storage): cancel SmithyOperation on upload file pause and cancel
    • feat(storage): expose operation control APIs for upload data operation
    • feat(storage): revise list API interface and add excludeSubPaths parameter

    Fixes

    • fix(api): correct subscription error handling (#2179)
    • fix(api): fix model helper util on web (#2270)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.10(Nov 10, 2022)

  • v0.6.9(Oct 12, 2022)

    • feat(storage): Support custom prefix (#2071)

    • fix(api): support multiple belongsTo (#2087)

    • fix(datastore): support nested predicates for observe and observeQuery (#2043)

    • fix(datastore): enable java8 desugaring for amplify-android datastore (#2232)

    • fix(storage): Custom Prefix Android (#2142)

    • chore: add cloudwatch monitoring for getting started smoke test (#2157)

    • chore: update category support tables (#2138)

    • chore(analytics): Integration test stack improvements

    • chore(api): add targetName to generated models used in tests (#2234)

    • chore(datastore): run integ tests in CI (#2182)

    • test(analytics): Add integration test backend

    • test(analytics): Add events integration tests

    Source code(tar.gz)
    Source code(zip)
  • v0.6.8(Sep 19, 2022)

    • feat(authenticator): listen to all auth hub events (#2053)
    • fix(core): Podspec deployment target (#2099)
    • fix(storage): Download to existing file (#2116)
    • fix(datastore): cpk errors on a custom type (#2134)
    • chore(core): Export safePrint from amplify_core (#2114)
    • chore(auth): enable integration tests in CI (#1886)
    • chore(repo): Update bug report to include deployment option (#1928)
    • chore(api): add field to schema in provision script (#1909)
    • chore(storage): Update dependencies (#2116)
    • chore(storage): Download to temp file (#2116)
    • chore: adds platform/category table (#2115)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.7(Sep 8, 2022)

  • v0.6.6(Aug 16, 2022)

    • chore: bump amplify-android dep to 1.37.2 (#2036)
    • chore(datastore): improve custom primary key integration tests (#2000)
    • chore: bump amplify-ios dep to 1.28.0 (#2005)
    • chore: bump amplify-android dep to 1.37.0 (#2005)
    • fix(datastore): adapt amplify-ios CPK fix breaking change (#2005)
    • fix(datastore): missing query field model name cause ambigous column … (#1941)
    • chore(datastore): upgrade amplify-ios to cpk preview version (#1641)
    • chore(datastore): add custom primary key integration tests (#1641)
    • chore(datastore): update integration tests model schema (#1641)
    • feat(datastore): add targetNames support for codegen (#1641)
    • chore(datastore): unit tests for custom primary key native imp. (#1641)
    • chore(datastore): unit tests for custom primary key in Flutter (#1641)
    • feat(datastore): custom primary key Flutter native implementation (#1641)
    • chore(datastore): cleanup the codebase (#1641)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-next.0(Aug 2, 2022)

    Initial developer preview release for all platforms.

    Developer Preview

    The Amplify Flutter libraries are being rewritten in Dart. This version is part of our developer preview for all platforms and is not intended for production usage. Please follow our Web and Desktop support tickets to monitor the status of supported categories. We will be releasing Web and Desktop support for all Amplify categories incrementally.

    For production use cases please use the latest, non-tagged versions of amplify-flutter packages from pub.dev. They offer a stable, production-ready experience for Android and iOS.

    Source code(tar.gz)
    Source code(zip)
  • v0.6.5(Jul 28, 2022)

  • v0.6.4(Jul 26, 2022)

    • This release resolves an issue in which storage operations were causing a persistent notification reading 'Amplify transfer service is running'. The underlying amplify-android library will now dismiss this notification once the transfer service finishes.

    • chore: bump amplify-android dep to 1.36.4 (#1918)

    Source code(tar.gz)
    Source code(zip)
  • v0.6.3(Jul 21, 2022)

    Fixes

    • fix(storage): throw pluginNotAddedException when storage plugin not configured (https://github.com/aws-amplify/amplify-flutter/pull/1903)

    Chores

    • chore: bump amplify-android dep to 1.36.3 (https://github.com/aws-amplify/amplify-flutter/pull/1911)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.2(Jul 14, 2022)

    • fix(datastore): delete test fix (#1880)
    • chore(authenticator): Update versions on the README (#1854)
    • fix(authenticator): fixes configure call in custom auth test and removes redundant test (#1878)
    • feat(auth): runtime authFlow attribute (#1687)
    • chore: enable integration tests in gh actions (#1754)
    • chore(authenticator): Fix typo in error message (#1846)
    • test(authenticator): add golden tests for new configs (#1831)
    • chore: add meta to storage deps (#1856)
    • chore: fix various integ test issues (#1838)
    • chore: upgrade amplify-android to 1.36.1 (#1841)
    • chore(deps): bump mocktail in /packages/amplify_authenticator (#1582)
    • chore: Update line endings to LF (#1836)
    • chore(repo): Update mono_repo (#1821)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Jun 30, 2022)

  • v0.6.0(Jun 20, 2022)

    Breaking Changes

    • Bump minimum Dart SDK to 2.15

    Fixes

    • fix(api): Concurrent access to OperationsManager
    • fix(auth): Fix device serialization
    • fix(authenticator): Trim strings for password confirmation comparison
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(May 24, 2022)

    Fixes

    • fix(api): OperationsManager crash (#1598)
    • fix(api): support enums in query predicates for model helpers (#1595)
    • fix(datastore): invalid model id field name implication (#1600)
    • fix(datastore): update in memory sorts and filters for IDs (#1597)
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(May 17, 2022)

    Breaking Changes

    • Auth: Auth API Changes

      • Previously, the Amplify.Auth.deleteUser API would throw UnimplementedException when it was called on Android platform. With this release, this API becomes functional and will delete currently signed in user on Android platform.

        How to Migrate:

        • Remove unwanted calls of the Amplify.Auth.deleteUser API, if you were handling the UnimplementedException exception for Android
      • Custom Auth flows are now available with passwordless logins. To support this change, the password attribute is now optional in the Auth.signIn API. While this should not prove breaking in most cases, we are calling it out since it alters a very commonly used API.

        How to Migrate:

        • Pass null to the Auth.signIn API only for passwordless login, using Cognito Custom Auth flows

    Features

    • feat(auth): add deleteUser support for Android (#1540)
    • feat(auth): enables custom auth flows (#1444)
    • feat(datastore): Custom Conflict Handler (#1254)
    • feat(datastore): emit subscriptionDataProcessed and syncReceived events (#1351)
    • feat(datastore): Multi-auth (#1478)
    • feat: AWS Signature V4 library (#1456)

    Fixes

    • fix: support lists for .contains query predicate in observeQuery (#1233)
    • fix(auth): Fix FlutterAuthProvider.kt (#1505)
    • fix(core): Update QueryPagination page field to default to 0 (#1533)
    • fix(authenticator): Fix confirm password validator (#1542)
    • fix(aws_signature_v4): Various fixes (#1572)

    Chores

    • chore(amplify_api): federated plugin (#1410)
    • chore(amplify_flutter): migrate amplify_flutter to federated plugin (#1450)
    • chore: make example Android Apps runnable with API 32+ (#1474)
    • chore(auth): Templatize and update exception comments (#1476)
    • chore(ci): Bump Xcode version
    • chore: update android compileSdkVersion to 31
    • chore: upgrade gradle plugin to 7.1.2
    • chore: enable android codebase linter checks
    • chore: replace 0.4.2-1 with 0.4.3 due to melos limitation (#1496)
    • chore(aws): Bump min SDK version (#1551)
    • chore: Lint fixes (#1471)
    • chore(authenticator): Fix failing integration tests (#1545)
    • chore: enable dependabot (#1568)
    • chore: Flutter 3 fixes (#1580)
    • chore: bump amplify-android version to 1.35.3 (#1586)
    • chore: downgrade amplify-android to 1.33.0 (#1591)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.5(Apr 13, 2022)

  • v0.4.4(Apr 6, 2022)

  • v0.4.3(Apr 2, 2022)

  • v0.4.2(Mar 24, 2022)

    Fixes

    • fix(api): model helpers query predicates correctly translates query by associated id (https://github.com/aws-amplify/amplify-flutter/pull/1417)
    • fix(analytics): adds flutter sdk to example apps (https://github.com/aws-amplify/amplify-flutter/pull/1465)

    Chores

    • chore(api): support decoding custom list request (https://github.com/aws-amplify/amplify-flutter/pull/1420)
    • chore(datastore): enable query predicate integration tests for float values (https://github.com/aws-amplify/amplify-flutter/pull/1454)
    • chore(analytics): switch to federated plugins (https://github.com/aws-amplify/amplify-flutter/pull/1378)
    • chore(auth): fix pubspec urls (https://github.com/aws-amplify/amplify-flutter/pull/1424)
    • chore(auth): federated plugin (https://github.com/aws-amplify/amplify-flutter/pull/1349)
    • chore(storage): federated plugin (https://github.com/aws-amplify/amplify-flutter/pull/1407)
    • chore: bump amplify-android to 1.32.1 (https://github.com/aws-amplify/amplify-flutter/pull/1448)
    • chore: bump amplify-ios to 1.22.0 (https://github.com/aws-amplify/amplify-flutter/pull/1468)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Feb 28, 2022)

    Fixes

    • fix(datastore): delete default predicate causes deletion failure #1409
    • fix(core): Update AtomicResult interface #1393
    • fix(flutter): Export category interfaces #1384
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Feb 17, 2022)

    Breaking Changes

    API: The data field in GraphQLResponse is now nullable.

    Kotlin version bumped to 1.6.10. If you are using Flutter 2.10 or above, you will need to ensure that your app supports an up-to-date Kotlin version (https://docs.flutter.dev/release/breaking-changes/kotlin-version). This will typically be version 1.5.31 or higher.

    Features

    • feat(amplify_api): Model-based GraphQL helpers, see updated docs for usage https://docs.amplify.aws/lib/graphqlapi/getting-started/q/platform/flutter/. (https://github.com/aws-amplify/amplify-flutter/pull/1211)
    • feat(datastore): Add QueryPredicate to Save/Delete (https://github.com/aws-amplify/amplify-flutter/pull/1336)
    • feat(datastore): Add QueryPredicate to Observe (https://github.com/aws-amplify/amplify-flutter/pull/1332)
    • feat(datastore): Add QueryPredicate.all (https://github.com/aws-amplify/amplify-flutter/pull/1310)
    • feat(amplify_flutter): allow customers to override AmplifyClass methods (https://github.com/aws-amplify/amplify-flutter/pull/1325)

    Fixes

    • fix(datastore): DataTime value comparison is inaccurate (https://github.com/aws-amplify/amplify-flutter/pull/1326)
    • fix(datastore): Hub memory usage (https://github.com/aws-amplify/amplify-flutter/pull/1201)

    Chores

    • chore(amplify_authenticator): remove support for amplify theme (https://github.com/aws-amplify/amplify-flutter/pull/1367)
    • chore(flutter): Fix AtomicResultTest (https://github.com/aws-amplify/amplify-flutter/pull/1363)
    • chore(amplify_authenticator): update amplify_flutter dep to >=0.3.0 <0.5.0 (https://github.com/aws-amplify/amplify-flutter/pull/1361)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Jan 24, 2022)

  • v0.3.1(Jan 21, 2022)

  • v0.3.0(Jan 20, 2022)

    Breaking Changes

    • Flutter: Linting & clean up (#1202)

      How to Migrate:

      • Update all imports of import 'package:amplify_flutter/amplify.dart'; to import 'package:amplify_flutter/amplify_flutter.dart';
    • API: This version changes GraphQL subscription interface to use Streams. See the amplify_api page for additional information.

    • Auth: The fetchAuthSession API will throw a SignedOutException when the user has not signed in, and a SessionExpiredException when the tokens have expired.

    • Auth: The getCurrentUser API will return an AuthUser if the user is still authenticated but the session has expired.

    • DataStore: ModelProvider and ModelField interface changes

      How to Migrate:

      • Install the required version of @aws-amplify/cli as described on the amplify_datastore page
      • Run amplify codegen models to regenerate models
    • DataStore: This version introduces a breaking change to Android Apps as an existing bug writes Double and Boolean values as TEXT in local SQLite database. The fix corrects this behavior. Hence, directly applying this fix may raise SQL error while reading from and writing to local database.

      How to Migrate:

      Invoke Amplify.DataStore.clear() on App start after upgrading to the latest version of Amplify Flutter. This API clears and recreates local database table with correct schema.

      NOTE: Data stored in local database and not synced to cloud will be lost, as local migration is not supported.

    Features

    • Amplify Authenticator preview release!
    • New AmplifyConfig type for fully-typed configurations
    • feat(api): GraphQL Subscription Stream (#905)
    • feat(datastore): Add CustomType functionality (#847)
    • feat(datastore): Add ModelField ReadOnly support (#599)

    Fixes

    • fix(api): remove tabs from graphql document strings in android (#1178)
    • fix(api): OIDC Fixes for REST/GraphQL
    • fix(auth): throw SignedOutException (#893)
    • fix(auth): fixes getCurrentUser disparity (#894)
    • fix(auth): remove int.parse from AuthUserAttribute (#1169)
    • fix(datastore): configure function triggers initial sync unexpectedly (#986)
    • fix(datastore): fix error map from ios (#1126)
    • break(datastore): cannot saving boolean as integer in SQLite (#895)

    Chores

    • chore(core): Linting & clean up (#1202)
    • chore(core): Add copyWith helpers (#1235)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.10(Nov 23, 2021)

  • v0.2.9(Nov 17, 2021)

  • v0.2.8(Nov 12, 2021)

    Fixes

    • fix(api): "Reply already submitted" crashes (#1058)
    • fix(auth): (Android) Dropped exceptions in hosted UI cause signInWithWebUI to not return (#1015)
    • fix(datastore): (Android) Fix DataStore release mode crash (#1064)
    • fix(storage): DateTime formatting and parsing (#1044, #1062)
    • fix(storage): Storage.list crash on null "options" (#1061)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.7(Nov 9, 2021)

    Chores

    • chore: Bump Amplify iOS to 1.15.5

    Fixes

    • fix(api): Fix OIDC/Lambda in REST/GraphQL on Android
    • fix(datastore): Temporal date/time query predicates
    • fix(datastore): Android TemporalTime Save Issue
    Source code(tar.gz)
    Source code(zip)
  • v0.2.6(Oct 25, 2021)

    Fixes

    • fix(datastore): Re-emit events on hot restart

    Features

    • feat(datastore): Add observeQuery API
    • feat(storage): Upload/download progress listener
    Source code(tar.gz)
    Source code(zip)
  • v0.2.5(Oct 14, 2021)

    Fixes

    • fix(api): OIDC/Lambda changes for DataStore
    • fix(auth): Add global sign out
    • fix(auth): Support preferPrivateSession flag
    • fix(datastore): Sync issues with owner-based auth
    • fix(datastore): Ensure attaching nested model schema
    • fix(datastore): Timeout period not increasing
    • fix(datastore): Remove default pagination behavior on iOS
    Source code(tar.gz)
    Source code(zip)
A guideline for building scalable Flutter applications.

Scalable flutter app You probably need to read this article before inspecting the repo's code. Building scalable Flutter apps (Architecture, Styling,

Nour El-Din Shobier 36 Nov 23, 2022
An application of learning outcomes from the Mastering Flutter 2.0 class: Building Travel and Aircraft Applications Buildwithangga

An application of learning outcomes from the Mastering Flutter 2.0 class: Building Travel and Aircraft Applications Buildwithangga

Latoe 2 Aug 29, 2022
building a timer application using the bloc library

flutter_timer A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Simon Wambua 0 Nov 4, 2021
A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background which in turn increases your credit score.

Sahayog A simple easy to use Flutter DApp , which keeps a track of all your day to day transactions by using Ethereum blockchain in the background whi

Utkarsh Agarwal 15 May 21, 2022
A simple and easy to use Redis client for Dart

redis_dart A simple and minimalist Redis client for Dart See it in pub: https://pub.dev/packages/redis_dart and GitHub: https://github.com/gabrielpach

Gabriel Pacheco 7 Dec 25, 2022
Easy to use open source Hub 🕸️ to control your smart devices from one app.

CyBear Jinni Hub Welcome! This repository is in charge of controlling smart devices and is part of the CyBear Jinni Smart Home system. The software is

CyBear Jinni 26 Nov 23, 2022
Easy to use open source Hub 🕸️ to control your smart devices from one app.

CyBear Jinni Hub Welcome! This repository is in charge of controlling smart devices and is part of the CyBear Jinni Smart Home system. The software is

CyBear Jinni 13 Jul 22, 2021
Super easy mood tracking app to demonstrate use of the Firebase Local Emulator Suite

Mood Tracker Example App in Flutter This is a simple example app showing how to use Cloud Functions and the Firebase Local Emulator inside a Flutter a

Andrea Bizzotto 8 Oct 14, 2022
Feature-rich and easy-to-use Minecraft Fallout server bot.

更好的 Minecraft 廢土伺服器機器人 ?? 介紹 這是個具有許多功能的廢土機器人,且完全免費與開源 另一大特色就是具有容易操作的界面,而不是傳統的小黑窗,讓任何人都能夠輕鬆使用~ 詳細功能請看 這裡 祝您使用愉快! 立即下載 ?? 下載 本軟體支援 Windows、Linux、macOS 作

菘菘 9 Dec 23, 2022
ghiNote is a quick note application with a good-looking interface and simple operation.

ghi_note ghiNote is a quick note application with a good-looking interface and simple operation. Getting Started This project is a starting point for

Ngo Thanh Son 0 Dec 15, 2021
The public interface for all dargon2 implementations

dargon2_interface This library generally should not be used in most contexts This library only provides an interface to implement a dargon2-compatible

Tejas Mehta 1 Jan 25, 2022
Repositório com o speed coding da interface da tela inicial do Nubank

Speed Coding - Nubank Este projeto visa reproduzir a interface da tela inicial do aplicativo Nubank. Como sempre, não há nenhum patrocínio envolvido e

Bruno Rangel 4 Dec 21, 2021
A tinder like interface for choosing Travel Destination.

Swipe Cards In Flutter This project implements the card swipping Feature like Tinder in flutter. I have shown different Hill Stations details with thi

Parikshit Gupta 43 Sep 29, 2022
A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

Skeletons A Flutter package for building custom skeleton widgets to mimic the page's layout while loading. Examples Items ListView (Default) ListView

Moh Badjah 46 Dec 17, 2022
A Dice App for flutter beginners when building with State

dicee A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Trần Văn Nguyên 1 Nov 15, 2021
Ready for Building Production-Ready Healthcare/ Doctor Consult Android and iOS app UI using Flutter.

Production-Ready Doctor Consultant App - Flutter UI Packages we are using: flutter_svg: link In this full series, we will show you how to Building Pro

Anurag Jain 26 Nov 28, 2022
Flutter SDK for building a realtime broadcaster using the Millicast platform

Flutter SDK for building a realtime broadcaster using the Millicast platform. This Software Development Kit (SDK) for Flutter allows developers to simplify Millicast services integration into their own Android and iOS apps.

Millicast, Inc. 9 Oct 29, 2022
Building a Chat App with Firebase, Image Upload, Push Notifications

chat_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Trần Văn Nguyên 2 Nov 15, 2021
Experiment for building file system.

experiment_file_system A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Kato Shinya 4 Nov 15, 2021