Git Product home page Git Product logo

aws-amplify / amplify-flutter Goto Github PK

View Code? Open in Web Editor NEW
1.3K 60.0 235.0 81.32 MB

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

Home Page: https://docs.amplify.aws

License: Apache License 2.0

Kotlin 4.46% Ruby 0.14% Swift 2.08% Objective-C 0.23% Dart 89.36% Shell 0.83% JavaScript 0.07% Makefile 0.03% HTML 0.29% TypeScript 1.38% Dockerfile 0.02% Java 0.22% CSS 0.03% CMake 0.29% C++ 0.31% C 0.04% Smithy 0.22%
amplify aws flutter dart mobile-development

amplify-flutter's Introduction

AWS Amplify

current aws-amplify package version weekly downloads GitHub Workflow Status (with event) code coverage join discord

Reporting Bugs / Feature Requests

Open Bugs Feature Requests Closed Issues

Note aws-amplify 6 has been released. If you are looking for upgrade guidance click here

AWS Amplify is a JavaScript library for frontend and mobile developers building cloud-enabled applications

AWS Amplify provides a declarative and easy-to-use interface across different categories of cloud operations. AWS Amplify goes well with any JavaScript based frontend workflow and React Native for mobile developers.

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.

Visit our documentation site to learn more about AWS Amplify. Please see the Amplify JavaScript page for information around the full list of features we support.

Features

Category AWS Provider Description
Authentication Amazon Cognito APIs and Building blocks to create Authentication experiences.
Analytics Amazon Pinpoint Collect Analytics data for your application including tracking user sessions.
REST API Amazon API Gateway Sigv4 signing and AWS auth for API Gateway and other REST endpoints.
GraphQL API AWS AppSync Interact with your GraphQL or AWS AppSync endpoint(s).
DataStore AWS AppSync Programming model for shared and distributed data, with simple online/offline synchronization.
Storage Amazon S3 Manages content in public, protected, private storage buckets.
Geo (Developer preview) Amazon Location Service Provides APIs and UI components for maps and location search for JavaScript-based web apps.
Push Notifications Amazon Pinpoint Allows you to integrate push notifications in your app with Amazon Pinpoint targeting and campaign management support.
Interactions Amazon Lex Create conversational bots powered by deep learning technologies.
PubSub AWS IoT Provides connectivity with cloud-based message-oriented middleware.
Internationalization --- A lightweight internationalization solution.
Cache --- Provides a generic LRU cache for JavaScript developers to store data with priority and expiration settings.
Predictions Various* Connect your app with machine learning services like NLP, computer vision, TTS, and more.
  • Predictions utilizes a range of Amazon's Machine Learning services, including: Amazon Comprehend, Amazon Polly, Amazon Rekognition, Amazon Textract, and Amazon Translate.

Getting Started

AWS Amplify is available as aws-amplify on npm.

To get started pick your platform from our Getting Started home page

Notice:

Amplify 6.x.x has breaking changes. Please see the breaking changes on our migration guide

Amplify 5.x.x has breaking changes. Please see the breaking changes below:

  • If you are using default exports from any Amplify package, then you will need to migrate to using named exports. For example:

    - import Amplify from 'aws-amplify';
    + import { Amplify } from 'aws-amplify'
    
    - import Analytics from '@aws-amplify/analytics';
    + import { Analytics } from '@aws-amplify/analytics';
    // or better
    + import { Analytics } from 'aws-amplify';
    
    - import Storage from '@aws-amplify/storage';
    + import { Storage } from '@aws-amplify/storage';
    // or better
    + import { Storage } from 'aws-amplify';
  • Datastore predicate syntax has changed, impacting the DataStore.query, DataStore.save, DataStore.delete, and DataStore.observe interfaces. For example:

    - await DataStore.delete(Post, (post) => post.status('eq', PostStatus.INACTIVE));
    + await DataStore.delete(Post, (post) => post.status.eq(PostStatus.INACTIVE));
    
    - await DataStore.query(Post, p => p.and( p => [p.title('eq', 'Amplify Getting Started Guide'), p.score('gt', 8)]));
    + await DataStore.query(Post, p => p.and( p => [p.title.eq('Amplify Getting Started Guide'), p.score.gt(8)]));
  • Storage.list has changed the name of the maxKeys parameter to pageSize and has a new return type that contains the results list. For example:

    - const photos = await Storage.list('photos/', { maxKeys: 100 });
    - const { key } = photos[0];
    
    + const photos = await Storage.list('photos/', { pageSize: 100 });
    + const { key } = photos.results[0];
  • Storage.put with resumable turned on has changed the key to no longer include the bucket name. For example:

    - let uploadedObjectKey;
    - Storage.put(file.name, file, {
    -   resumable: true,
    -   // Necessary to parse the bucket name out to work with the key
    -   completeCallback: (obj) => uploadedObjectKey = obj.key.substring( obj.key.indexOf("/") + 1 )
    - }
    
    + let uploadedObjectKey;
    + Storage.put(file.name, file, {
    +   resumable: true,
    +   completeCallback: (obj) => uploadedObjectKey = obj.key
    + }
  • Analytics.record no longer accepts string as input. For example:

    - Analytics.record('my example event');
    + Analytics.record({ name: 'my example event' });
  • The JS export has been removed from @aws-amplify/core in favor of exporting the functions it contained.

  • Any calls to Amplify.Auth, Amplify.Cache, and Amplify.ServiceWorker are no longer supported. Instead, your code should use the named exports. For example:

    - import { Amplify } from 'aws-amplify';
    - Amplify.configure(...);
    - // ...
    - Amplify.Auth.signIn(...);
    
    + import { Amplify, Auth } from 'aws-amplify';
    + Amplify.configure(...);
    + // ...
    + Auth.signIn(...);

Amplify 4.x.x has breaking changes for React Native. Please see the breaking changes below:

  • If you are using React Native (vanilla or Expo), you will need to add the following React Native community dependencies:
    • @react-native-community/netinfo
    • @react-native-async-storage/async-storage
// React Native
yarn add aws-amplify amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage
npx pod-install

// Expo
yarn add aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage

Amplify 3.x.x has breaking changes. Please see the breaking changes below:

If you can't migrate to aws-sdk-js-v3 or rely on [email protected], you will need to import it separately.

  • If you are using exported paths within your Amplify JS application, (e.g. import from "@aws-amplify/analytics/lib/Analytics") this will now break and no longer will be supported. You will need to change to named imports:

    import { Analytics } from 'aws-amplify';
  • If you are using categories as Amplify.<Category>, this will no longer work and we recommend to import the category you are needing to use:

    import { Auth } from 'aws-amplify';

DataStore Docs

For more information on contributing to DataStore / how DataStore works, see the DataStore Docs

amplify-flutter's People

Contributors

aaronzylee avatar abhishek01039 avatar alegos27 avatar amplifiyer avatar asaarnak avatar ashish-nanda avatar bluprince13 avatar caravanat avatar cshfang avatar czaefferer avatar dependabot[bot] avatar dnys1 avatar equartey avatar fjnoyp avatar haverchuck avatar hexch avatar huisf avatar jamesonwilliams avatar jordan-nelson avatar khatruong2009 avatar marlonjd avatar mauerbac avatar mlabieniec avatar nikahsn avatar offlineprogrammer avatar passsy avatar ragingsquirrel3 avatar rubensdemelo avatar samaritan1011001 avatar sutran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amplify-flutter's Issues

"Hot restart" is causing a subsequent call to `Amplify.configure`

Describe the bug
PlatformException (PlatformException(AmplifyException, The client issued a subsequent call to Amplify.configure after the first had already succeeded., {cause: null, recoverySuggestion: Be sure to only call Amplify.configure once}))

To Reproduce
Steps to reproduce the behavior:

  Amplify amplify = Amplify();
  bool _isAmplifyConfigured = false;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _initAmplifyFlutter();
  }

  void _initAmplifyFlutter() async {
    print("init amplify");
    AmplifyAuthCognito auth = AmplifyAuthCognito();

    amplify.addPlugin(
      authPlugins: [auth],
    );
    // Initialize AmplifyFlutter
    await amplify.configure(amplifyconfig);

    setState(() {
      _isAmplifyConfigured = true;
    });
  }

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducable in (check all that apply):
[x] Android
[] iOS (cant test)

Additional context
This Error happens in VSCode when hot restarting.

Simplify amplifyconfiguration.dart

Hello guys, thank you for putting together amplify for flutter.

After playing with the project I noticed if you want to use another tool like CDK to generate aws resources is a little cumbersome to edit the amplifyconfiguration.dart file. I have used before the amplify Auth lib and I don't remember it been that complicated.

In simple words the file amplifyconfiguration.dart is not easy to edit by hand, so having a simplified structure would be great for users having the aws resources created already.

Keep the awesome work 😃

Feature Request: Handling different environments/multiple user-pools

Hello guys, I'm trying out AWS Amplify at the moment and I've stumbled around issue, that I couldn't see how could one handle different environments or multiple user-pools.

Currently, we have amplifyconfiguration.dart autogenerated and for initialisation we use await amplify.configure(amplifyconfig); . amplifyconfig is the constant String in amplifyconfiguration.dart.

However, what if one has 2 or more different environments. In simplest scenario - development and production? Or multiple user-pools? Is it currently possible? Or is it in the roadmap?

Thank you

"Hot restart" is causing a subsequent call to `Amplify.configure`

See #94, which was closed by the author of the issue.

Describe the bug

PlatformException (PlatformException(AmplifyException, The client issued a subsequent call to Amplify.configure after the first had already succeeded., {cause: null, recoverySuggestion: Be sure to only call Amplify.configure once}))

To Reproduce

Steps to reproduce the behavior:

  Amplify amplify = Amplify();
  bool _isAmplifyConfigured = false;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _initAmplifyFlutter();
  }

  void _initAmplifyFlutter() async {
    print("init amplify");
    AmplifyAuthCognito auth = AmplifyAuthCognito();

    amplify.addPlugin(
      authPlugins: [auth],
    );
    // Initialize AmplifyFlutter
    await amplify.configure(amplifyconfig);

    setState(() {
      _isAmplifyConfigured = true;
    });
  }

Platform

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

Smartphone (please complete the following information):

  • Device: Android
  • Mac

Additional context

The error happens when hot restarting the app.

No implementation found for method configure on channel com.amazonaws.amplify/core - on Android back button click

  1. On Android, run the example app
  2. When the LandingPage is shown with the "Sign In" and "Sign Up" buttons, hit the back button until the Android home screen is displayed.
  3. Hit the Android app switcher button (rightmost) and return to the example app. App stays on the LoadingPage.
    Console log shows:
    E/flutter (31034): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/core)
    E/flutter (31034): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
    E/flutter (31034):
    E/flutter (31034): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
    E/flutter (31034): #2 MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
    E/flutter (31034): #3 Amplify.configure (package:amplify_core/amplify_core.dart:71:35)
    E/flutter (31034): #4 _MyAppState._initAmplifyFlutter (package:sample_app/main.dart:61:19)
    E/flutter (31034): #5 _MyAppState.initState (package:sample_app/main.dart:52:5)
    E/flutter (31034): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4684:58)
    E/flutter (31034): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4520:5)
    E/flutter (31034): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3490:14)
    E/flutter (31034): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:3258:18)
    E/flutter (31034): #10 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1174:16)
    E/flutter (31034): #11 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1145:5)
    E/flutter (31034): #12 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:1087:17)
    E/flutter (31034): #13 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2620:19)
    E/flutter (31034): #14 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1086:13)
    E/flutter (31034): #15 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:927:7)
    E/flutter (31034): #16 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:908:7)
    E/flutter (31034): #17 _rootRun (dart:async/zone.dart:1182:47)

Originally posted by @kjones in #80 (comment)

Unsupported value: org.json.JSONException: No value for region)

Describe the bug
Amplify.configure() doesn't work. Problem loading amplifyconfig string. Seems to be a parsing problem.

Expected behavior
config file should load

here is the file:

const amplifyconfig = ''' {
  "UserAgent": "aws-amplify-cli/2.0",
  "Version": "1.0",
  "auth": {
      "plugins": {
          "awsCognitoAuthPlugin": {
              "IdentityManager": {
                  "Default": {}
              },
              "CredentialsProvider": {
                  "CognitoIdentity": {
                      "Default": {
                          "PoolId": "xxxxxxxxxxxxx
                          "Region": "eu-west-1"
                      }
                  }
              },
              "CognitoUserPool": {  
                  "Default": {
                      "PoolId": "xxxxx",
                      "AppClientId": "xxxxxxxxxxxxxxxxx",
                      "Region": "eu-west-1"
                  }
              },
              "Auth": {
                  "Default": {
                      "authenticationFlowType": "USER_SRP_AUTH"
                  }
              }
          }
      }
  }
}''';

Platform
Android

Additional context
was working before. Not that I think it matters but I updated amplify cli.

iOS isn't throwing an AuthError when the user is not confirmed

Describe the bug
When trying to authenticate using a user with "Account status" "UNCONFIRMED" on iOS the library doesn't throw an Error. While in Android the library throws an AuthError with the details of the Error showing that the user is not confirmed.

To Reproduce
Steps to reproduce the behavior:

  1. execute Amplify.Auth.signUp to create a new user, but don't call Amplify.Auth.confirmSignUp.
  2. execute Amplify.Auth.signIn using the previously created user.

Expected behavior
iOS must have the same behavior as Android throwing an AuthError with the details about the Exception.

Platform
[] Android
[x] iOS

Smartphone (please complete the following information):

  • Device: iOS Simulator - iPhone 11 Pro
  • OS: iOS 14.0
  • Browser: N/A
  • Version [e.g. 22]

Additional context

Future<String> onLogin(LoginData data) async {
    print('onLogin: Name: ${data.name}, Password: ${data.password}');
    try {
      SignInResult res = await Amplify.Auth.signIn(
        username: data.name.trim(),
        password: data.password.trim(),
      );
      setState(() {
        //isSignedIn = res.isSignedIn;
        print('isSignedIn: ${res.isSignedIn}');
      });
      if (res.nextStep.signInStep == 'DONE') return null;
      if (res.nextStep.signInStep == '') // TODO: Implement go to confirm_sign_up_step
      if (!res.isSignedIn) return 'Ha ocurrido un error';

      return null;
    } on AuthError catch (e) {
      print(e);
      return e.exceptionList
          .firstWhere((i) => i.exception.toLowerCase() == 'platform_exceptions')
          .detail['localizedErrorMessage'];
    }
  }

On iOS Amplify.Auth.signIn method returns an CognitoSignInResult:

{
  "isSignedIn": false,
  "nextStep": {
    "additionalInfo": null,
    "codeDeliveryDetails": {
      "attributeName": "",
      "deliveryMedium": "",
      "destination": ""
    },
    "signInStep": "ERROR"
  }
}

On Android Amplify.Auth.signIn method returns an AuthError:

{
  "cause": "AMPLIFY_SIGNIN_FAILED",
  "exceptionList": [{
      "exception": "USER_NOT_CONFIRMED",
      "detail": "User is not confirmed."
    },
    {
      "exception": "PLATFORM_EXCEPTIONS",
      "detail": {
        "platform": "Android",
        "localizedErrorMessage": "Sign in failed",
        "recoverySuggestion": "See attached exception for more details",
        "errorString": "AmplifyException {message=Sign in failed, cause=com.amazonaws.services.cognitoidentityprovider.model.UserNotConfirmedException: User is not confirmed. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UserNotConfirmedException; Request ID: f7031b99-1c40-430c-9745-bdcbce8d3c91), recoverySuggestion=See attached exception for more details}"
      }
    }
  ]
}

Failed to Configure Amplify

Describe the bug
Hi, I'm using existing resources (user pools and identity pools) for my amplifyconfiguration.dart. But I'm unable to configure amplify.

VERBOSE-2:ui_dart_state.cc(171)] Unhandled Exception: PlatformException(AmplifyException, Failed to Configure Amplify, The operation couldn’t be completed. (Amplify.ConfigurationError error 0.))
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:571:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:160:18)
<asynchronous suspension>
#2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:333:12)
#3      MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
#4      Amplify.configure (package:amplify_core/amplify_core.dart:71:35)
#5      _MyHomepageState._configureAmplify (package:Rio/main.dart:42:27)
#6      _MyHomepageState.initState (package:Rio/main.dart:31:5)
#7      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4702:58)
#8      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4538:5)

To Reproduce

I presume this is a problem with my amplifyconfiguration.dart file. So I'll post it here and see if you can see anything wrong...
I'm finding it hard to debug the problem so any debugging advice would be great!

const amplifyconfig = ''' {
  "UserAgent": "aws-amplify-cli/2.0",
  "Version": "1.0",
  "auth": {
      "plugins": {
          "awsCognitoAuthPlugin": {
              "IdentityManager": {
                  "Default": {}
              },
              "CredentialsProvider": {
                  "CognitoIdentity": {
                      "Default": {
                          "PoolId": "eu-west-1:2dxx4dxxxx0740-xxx-4f40-aa90-xxxxcxx",
                          "Region": "eu-west-1"
                      }
                  }
              },
              "CognitoUserPool": {
                  "Default": {
                      "PoolId": "eu-west-1_xxxxxxxxxj",
                      "AppClientId": "xxxxxxxxxxxxxxxxx",
                      "Region": "eu-west-1"
                  }
              },
              "Auth": {
                  "Default": {
                      "authenticationFlowType": "USER_SRP_AUTH"
                  }
              }
          }
      }
  }
}''';

Expected behavior
That amplify configure works without any errors

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

Platform
Both Android and iOS

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

No implementation found for method configure on channel com.amazonaws.amplify/core

Describe the bug
When running the example app and viewing the loading page to the it will show a Missing plugin exception.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the example app
  2. Run the example app
  3. See error

Expected behavior
No exceptions thrown
Screenshots
Exception which i receive:

[ERROR:flutter/lib/ui/ui_dart_state.cc(167)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/core)
E/flutter ( 9324): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
E/flutter ( 9324):
E/flutter ( 9324): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
E/flutter ( 9324): #2 MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
E/flutter ( 9324): #3 Amplify.configure (package:amplify_core/amplify_core.dart:66:35)
E/flutter ( 9324): #4 _MyAppState._initAmplifyFlutter (package:example/main.dart:34:19)
E/flutter ( 9324): #5 _MyAppState.initState (package:example/main.dart:23:5)
E/flutter ( 9324): #6 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4697:58)
E/flutter ( 9324): #7 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4533:5)
E/flutter ( 9324): #8 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3503:14)
E/flutter ( 9324): #9 Element.updateChild (package:flutter/src/widgets/framework.dart:3262:18)
E/flutter ( 9324): #10 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1217:16)
E/flutter ( 9324): #11 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1188:5)
E/flutter ( 9324): #12 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:1130:17)
E/flutter ( 9324): #13 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2622:19)
E/flutter ( 9324): #14 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1129:13)
E/flutter ( 9324): #15 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:941:7)
E/flutter ( 9324): #16 WidgetsBinding.scheduleAttachRootWidget. (package:flutter/src/widgets/binding.dart:922:7)
E/flutter ( 9324): #17 _rootRun (dart:async/zone.dart:1182:47)
E/flutter ( 9324): #18 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 9324): #19 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 9324): #20 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
E/flutter ( 9324): #21 _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 9324): #22 _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 9324): #23 _CustomZone.bindCallback. (dart:async/zone.dart:1021:23)
E/flutter ( 9324): #24 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
E/flutter ( 9324): #25 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
E/flutter ( 9324): #26 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
E/flutter ( 9324): #27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
E/flutter ( 9324):

Platform
Android flutter

Smartphone (please complete the following information):
Android emulator running Android 10.0, API 29

Unable to sign-in user. MFAMethodNotFoundException was raised.

Describe the bug
Able to sign-up user, but unable to sign-in. MFAMethodNotFoundException was raised after submission, but no MFA message received. Check user pool, user account status is 'Confirmed' and 'Enabled' with email verified set 'true', and SMS MFA Status - 'Disabled'

To Reproduce
Steps to reproduce the behavior:

  1. Sign-up user with basic info (name, email, password)
  2. User email inbox received MFA verification code
  3. Enter 6 digit verification code and submit
  4. Return sign-up complete successfully
  5. Go to Sign-in page
  6. Enter user email + password and submit
  7. Returns the MFAMethodNotFoundException message

Expected behavior
Either sign-in succeed or received new MFA verification code in user inbox for multi-factor authentication

Screenshots
W/CognitoUserSession(28635): CognitoUserSession is not valid because idToken is null.
D/AWSMobileClient(28635): Sending password.
E/amplify:flutter:auth_cognito(28635): AMPLIFY_SIGNIN_FAILED
E/amplify:flutter:auth_cognito(28635): AmplifyException {message=Sign in failed, cause=com.amazonaws.services.cognitoidentityprovider.model.MFAMethodNotFoundException: No MFA mechanism registerd in the account. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: MFAMethodNotFoundException; Request ID: 9a418ff2-7333-4138-be5b-eac965efaad8), recoverySuggestion=See attached exception for more details}
E/amplify:flutter:auth_cognito(28635): at com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin$5.onError(AWSCognitoAuthPlugin.java:357)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.internal.InternalCallback.call(InternalCallback.java:77)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.internal.InternalCallback.onError(InternalCallback.java:67)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.AWSMobileClient$6$1.onFailure(AWSMobileClient.java:1258)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser$6.onFailure(CognitoUser.java:1155)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser$23.run(CognitoUser.java:2915)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser$24.run(CognitoUser.java:2965)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation.continueTask(AuthenticationContinuation.java:147)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.AWSMobileClient$6$1.getAuthenticationDetails(AWSMobileClient.java:1222)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getSession(CognitoUser.java:1032)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.AWSMobileClient$6.run(AWSMobileClient.java:1176)
E/amplify:flutter:auth_cognito(28635): at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
E/amplify:flutter:auth_cognito(28635): at java.lang.Thread.run(Thread.java:818)
E/amplify:flutter:auth_cognito(28635): Caused by: com.amazonaws.services.cognitoidentityprovider.model.MFAMethodNotFoundException: No MFA mechanism registerd in the account. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: MFAMethodNotFoundException; Request ID: 9a418ff2-7333-4138-be5b-eac965efaad8)

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducable in (check all that apply):
[x] Android
[N/A] iOS

Additional context
Maybe this is not related to the Amplify flutter itself. I suspect the reason cause is due to I enable the SMS text message for MFA second factors during the initial setup, which I never use it during my authentication process (phone number is not required). The only reason I enable it is simply to keep it as an option in case I need it in the future.

Able to sign in, after deleting the user from aws cognito console

After completing the signup, and sing in, I deleted the user from cognito console. And tried to sign in from the device, which is still working.

To Reproduce
Steps to reproduce the behavior:

  1. Do signup
  2. Do signin
  3. Delete the user from aws cognito console (Web UI)
  4. Try sign in again from the code.

Expected behavior
User should not sign in

Log message

D/AWSMobileClient(19143): _federatedSignIn: Putting provider and token in store
D/AWSMobileClient(19143): Inspecting user state details
D/AWSMobileClient(19143): hasFederatedToken: true provider: cognito-idp.***
D/AWSMobileClient(19143): Inspecting user state details
D/AWSMobileClient(19143): hasFederatedToken: true provider: cognito-idp.***
D/AWSMobileClient(19143): waitForSignIn: userState:SIGNED_IN
I/flutter (19143): DONE

S3 download failure crashes app

Describe the bug
When a download operation is failing the App is crashing because the a message reply has already been sent.

To Reproduce

final String path = Directory.systemTemp.createTempSync().path + "/tmpfile";
final DownloadFileOptions options = S3DownloadFileOptions(accessLevel: StorageAccessLevel.protected, targetIdentityId: "ABC123");
    final DownloadFileResult result = await Amplify.Storage.downloadFile(key: "cannot_access.key", local: File(path), options: options);
Shutting down VM
FATAL EXCEPTION: main
Process: com.myovolt.myovolt, PID: 22828
java.lang.IllegalStateException: Reply already submitted
	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:240)
	at com.amazonaws.amplify.amplify_storage_s3.AmplifyStorageOperations$StorageOperations$prepareError$1.run(AmplifyStorageOperations.kt:208)
	at android.os.Handler.handleCallback(Handler.java:914)
	...

To see this in action put attach the Android debugger with a breakpoint in error closure for
downloadFile() in AmplifyStorageOperations.kt

The first time prepareError is called it is with the S3 not found exception.

accept:136, AmplifyStorageOperations$StorageOperations$downloadFile$2 (com.amazonaws.amplify.amplify_storage_s3)
accept:30, AmplifyStorageOperations$StorageOperations$downloadFile$2 (com.amazonaws.amplify.amplify_storage_s3)
onError:195, AWSS3StorageDownloadFileOperation$DownloadTransferListener (com.amplifyframework.storage.s3.operation)
run:288, TransferStatusUpdater$4 (com.amazonaws.mobileconnectors.s3.transferutility)
handleCallback:914, Handler (android.os)

Second time it is called because of the "Failed" state change listened to by the
AWSS3StorageDownloadFileOperation$DownloadTransferListener

accept:136, AmplifyStorageOperations$StorageOperations$downloadFile$2 (com.amazonaws.amplify.amplify_storage_s3)
accept:30, AmplifyStorageOperations$StorageOperations$downloadFile$2 (com.amazonaws.amplify.amplify_storage_s3)
onStateChanged:176, AWSS3StorageDownloadFileOperation$DownloadTransferListener (com.amplifyframework.storage.s3.operation)
run:206, TransferStatusUpdater$2 (com.amazonaws.mobileconnectors.s3.transferutility)
handleCallback:914, Handler (android.os)

Expected behavior
Not to crash the app

Fix
It looks like expected behaviour of the AWSS3StorageDownloadFileOperation to notify the second failure is part of the Android implementation the easiest fix would be to check if the flutterResult has already been completed before calling flutterResult.error()in com.amazonaws.amplify.amplify_storage_s3.AmplifyStorageOperations$StorageOperations$prepareError

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[/] Android
[?] iOS - haven't tested

Missing Signup options cause NoSuchMethodError

Describe the bug
AuthCategory.signUp() parameter named options is treated as mandatory but is not a required field.

To Reproduce
Execute the following code and

final SignUpResult result = await Amplify.Auth.signUp(
  username: "username",
  password: "password",
);

SignUpRequest is created within the signUp method which has mandatory parameter named options (which is null set to null). This causes the exception

NoSuchMethodError: The method 'serializeAsMap' was called on null.

See: SignUpRequest Line 29

pendingRequest['options'] = options.serializeAsMap();

Fix

  1. Update method signature in AuthCategory.signUp to make options a required field
Future<SignUpResult> signUp({@required String username, @required password, @required SignUpOptions options}
  1. Update method signature in AuthCategory.signUp to give options a default value
Future<SignUpResult> signUp({@required String username, @required password, SignUpOptions options = const SignUpOptions()}
  1. Null check options in SignUpRequest.serializeAsMap()
if (options != null) {
  pendingRequest['options'] = options.serializeAsMap();
}

Feature Request: Possible to run cognito without configuring it via amplify

Currently, Amplify has quite some limitations. For example: There is no way to allow users to sign-in via main option and toggle additional options if project is initialised via amplify CLI.
Example Username + Also allow sign in with verified email address + Also allow sign in with verified phone number.
image

I've found, that similar issue is opened since 2019 May and it's not fixed yet. aws-amplify/amplify-cli#1546 This is a huge problem and currently, Flutter is limited to cognito set-up made solely from amplify CLI.

Until this issue is not fixed or it's not possible to run cognito without setting up via CLI - I'd expect much less popularity for this plugin, as this is one of the core functionalities of cognito.

Would love to hear any follow-up on this.

Amplify Pinpoint Event Type - Not appearing in pinpoint console

Describe the bug
I have an app that is configured with both AWS Cognito and Pinpoint. When I create new AnalyticsEvents (with a non-auth'ed user), the events are logged in the console numerically, but the 'event-type' drop-down never changes to accommodate the new events that I have added.

For example, if I create a new analytics event of type 'example' and create 10 events and then flush, I will get 10 events in my console but I won't have an event type 'example' under filters->Event.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/aws-amplify/amplify-flutter/tree/master/packages/amplify_analytics_pinpoint/example
  2. Initialize a project using aws analytics add and aws push
  3. Create new events and flush them through the app's UI

Expected behavior
Upon creating new events with different event types, the AWS Pinpoint -> Analytics -> Events -> Filter -> Event dropdown should reflect the new event types that I created. Thus far, it updates the count but doesn't show that there are new types.

Screenshots
image

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

Smartphone (please complete the following information):
Pixel 2 API 3, Android 10+

Fatal error when trying to upload image to s3 bucket

Describe the bug
Unexpectedly found nil while implicitly unwrapping an Optional value: file..../ios/Pods/AmplifyPlugins/AmplifyPlugins/Storage/AWSS3StoragePlugin/AWSS3StoragePlugin+ClientBehavior.swift, line 157
passing the file from the imagepicker
upload snippet:

await picker
   .getImage(source: ImageSource.gallery)
    .then((value) async {
        File fileInstance = File(value.path);
        final key = new DateTime.now().toString();
        UploadFileResult result =
            await Amplify.Storage.uploadFile(
                 key: key, local: fileInstance);
       });

crashing swift snippet (crashes on storageService):

let uploadFileOperation = AWSS3StorageUploadFileOperation(request,
                                                                  storageService: storageService,
                                                                  authService: authService,
                                                                  progressListener: progressListener,
                                                                  resultListener: resultListener)

I have an authenticated user.

To Reproduce
Steps to reproduce the behavior:

  1. Pass key and file to Amplify.Storage.uploadFile
  2. Raise exception in xcode

Expected behavior
I expect the file to upload.

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

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

Smartphone (please complete the following information):

  • Device: simulator 11 pro
  • OS: 13.6

Cannot SignUp (AMPLIFY_SIGNUP_FAILED)

Describe the bug
After running into issues in #142 and #143, trying to SignUp and receiving null-pointer.

To Reproduce

  1. Run the app;
  2. Execute SignUp
  3. Receive error
E/amplify:flutter:auth_cognito( 8525): AmplifyException {message=Sign up failed, cause=java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(java.lang.String, java.lang.String, com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes, java.util.Map, java.util.Map, com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.SignUpHandler)' on a null object reference, recoverySuggestion=See attached exception for more details}
E/amplify:flutter:auth_cognito( 8525): 	at com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin$2.onError(AWSCognitoAuthPlugin.java:275)
E/amplify:flutter:auth_cognito( 8525): 	at com.amazonaws.mobile.client.internal.InternalCallback.call(InternalCallback.java:77)
E/amplify:flutter:auth_cognito( 8525): 	at com.amazonaws.mobile.client.internal.InternalCallback.access$000(InternalCallback.java:34)
E/amplify:flutter:auth_cognito( 8525): 	at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:103)
E/amplify:flutter:auth_cognito( 8525): 	at java.lang.Thread.run(Thread.java:919)
E/amplify:flutter:auth_cognito( 8525): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(java.lang.String, java.lang.String, com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes, java.util.Map, java.util.Map, com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.SignUpHandler)' on a null object reference
E/amplify:flutter:auth_cognito( 8525): 	at com.amazonaws.mobile.client.AWSMobileClient$13.run(AWSMobileClient.java:2003)
E/amplify:flutter:auth_cognito( 8525): 	at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
E/amplify:flutter:auth_cognito( 8525): 	... 1 more

Expected behavior
There shouldn't be an exception.

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):
[x] Android
[] iOS

Smartphone (please complete the following information):
OnePlus 6

Additional context
I expect this issue is related to issues received in #142 and/or #143 and once these are fixed - this also will be fixed. I tried to debug internally, but couldn't see exactly why nullpointer is thrown.

Example App - CLI Getting Started - Android - AMPLIFY_SIGNUP_FAILED - NullPointerException, CognitoUserPool

I've run into a similar issue. I can also confirm that used flutter pub get to pull the packages in, and used amplify cli to initialise auth and analytics.
One thing to note tho that the analytics seem to work fine, and it's only the Auth that fails.

Error:

E/amplify:flutter:auth_cognito(11377): AMPLIFY_SIGNUP_FAILED E/amplify:flutter:auth_cognito(11377): AmplifyException {message=Sign up failed, cause=java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(java.lang.String, java.lang.String, com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes, java.util.Map, com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.SignUpHandler)' on a null object reference, recoverySuggestion=See attached exception for more details} E/amplify:flutter:auth_cognito(11377): at com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin$2.onError(AWSCognitoAuthPlugin.java:1) E/amplify:flutter:auth_cognito(11377): at com.amazonaws.mobile.client.internal.InternalCallback.call(InternalCallback.java:77) E/amplify:flutter:auth_cognito(11377): at com.amazonaws.mobile.client.internal.InternalCallback.access$000(InternalCallback.java:34) E/amplify:flutter:auth_cognito(11377): at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:103) E/amplify:flutter:auth_cognito(11377): at java.lang.Thread.run(Thread.java:919) E/amplify:flutter:auth_cognito(11377): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool.signUp(java.lang.String, java.lang.String, com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes, java.util.Map, com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.SignUpHandler)' on a null object reference E/amplify:flutter:auth_cognito(11377): at com.amazonaws.mobile.client.AWSMobileClient$13.run(AWSMobileClient.java:1894) E/amplify:flutter:auth_cognito(11377): at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101) E/amplify:flutter:auth_cognito(11377): ... 1 more I/flutter (11377): Instance of 'AuthError'

Originally posted by @lamorltd in #80 (comment)

amplify-flutter upload to s3 fails on both iOS and android

I used the below s3 upload code to try uploading the file to our public bucket but I get an exception on iOS and android.

try {
      print('In upload');
      // Uploading the file with options
      File local = await FilePicker.getFile(type: FileType.image);
      final key = new DateTime.now().toString();
      Map<String, String> metadata = <String, String>{};
      metadata['name'] = 'filename';
      metadata['desc'] = 'A test file';
      S3UploadFileOptions options = S3UploadFileOptions(
          accessLevel: StorageAccessLevel.private, metadata: metadata);
      UploadFileResult result = await Amplify.Storage.uploadFile(
          key: key, local: local, options: options);
      setState(() {
        _uploadFileResult = result.key;
      });
    } catch (e) {
      print('UploadFile Err: ' + e.toString());
    }

Exception on Android :

I/flutter (17626): UploadFile Err: PlatformException(AmplifyException, UPLOAD_FILE_OPERATION_FAILED, {PLATFORM_EXCEPTIONS: {platform: Android, localizedErrorMessage: Something went wrong with your AWS S3 Storage upload file operation, recoverySuggestion: See attached exception for more information and suggestions}})
E/amplify:flutter:storage_s3(17626): UPLOAD_FILE_OPERATION_FAILED
E/amplify:flutter:storage_s3(17626): AmplifyException {message=Storage upload operation was interrupted., cause=null, recoverySuggestion=Please verify that you have a stable internet connection.}
E/amplify:flutter:storage_s3(17626): 	at com.amplifyframework.storage.s3.operation.AWSS3StorageUploadFileOperation$UploadTransferListener.onStateChanged(AWSS3StorageUploadFileOperation.java:182)
E/amplify:flutter:storage_s3(17626): 	at com.amazonaws.mobileconnectors.s3.transferutility.TransferStatusUpdater$2.run(TransferStatusUpdater.java:206)
E/amplify:flutter:storage_s3(17626): 	at android.os.Handler.handleCallback(Handler.java:883)
E/amplify:flutter:storage_s3(17626): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/amplify:flutter:storage_s3(17626): 	at android.os.Looper.loop(Looper.java:214)
E/amplify:flutter:storage_s3(17626): 	at android.app.ActivityThread.main(ActivityThread.java:7116)
E/amplify:flutter:storage_s3(17626): 	at java.lang.reflect.Method.invoke(Native Method)
E/amplify:flutter:storage_s3(17626): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/amplify:flutter:storage_s3(17626): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)

Exception on iOS :

flutter: In upload
flutter: UploadFile Err: PlatformException(AmplifyException, UPLOAD_FILE_OPERATION_FAILED, {PLATFORM_EXCEPTIONS: {recoverySuggestion: TODO some status code to recovery message mapper.
For more information on HTTP status codes, take a look at
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes, platform: iOS, localalizedError: The HTTP response status code is [403].}})

I also get the below error sometimes

UploadFile Err: PlatformException(AmplifyException, UPLOAD_FILE_OPERATION_FAILED, {PLATFORM_EXCEPTIONS: {localalizedError: Access denied!, platform: iOS, recoverySuggestion: }})

This issue is reproducible in :
Android
iOS

Signin after an immediate password reset is accepting anypassword

Describe the bug
I am able to do the password reset, where cognito send me the confirmation code.
I am also able to reset the password, but after resetting the password, I tried to login with the old password(any text),
and it's accepting the sign. Is this an expected behavior ? Do we need to do additional cleanup like removing any internal tokens, which were stored on device ?

Here is the log message which I got while trying with wrong password or any password.

D/AWSMobileClient(18556): _federatedSignIn: Putting provider and token in store
D/AWSMobileClient(18556): Inspecting user state details
D/AWSMobileClient(18556): hasFederatedToken: true provider: cognito-idp****
D/AWSMobileClient(18556): Inspecting user state details
D/AWSMobileClient(18556): hasFederatedToken: true provider: cognito-idp****
D/AWSMobileClient(18556): waitForSignIn: userState:SIGNED_IN

To Reproduce

  1. Do signup
  2. Do sign in
  3. Do forgot password and reset the new password
  4. TRY TO LOGIN WITH OLD PASSWORD OR ANY OTHER PASSWORD

Expected behavior
User should get error message while he was trying to sign in with old password

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

Amplify CLI installation instructions

The setup instructions should say that you need the flutter preview version of the CLI else you can't setup the app as when you run amplify init there is no Flutter option for Choose the type of app that you're building

npm install -g @aws-amplify/cli@flutter-preview

Essential method not implemented yet

In cognito, getting Id_token and user_token is essential to make this package useful and valuable. But this part is not even in the developer preview version yet. Should be in high priority of TODOS

Question about Database Support

Hey guys,

I have received a few questions regarding database support for Amplify Flutter (eg. what is the equivalent to Firestore?).

What are the future plans for integrating some of AWS database solutions with Flutter?

Thanks a lot,

Adam

How to handle CONFIRM_SIGN_IN_WITH_NEW_PASSWORD after authentication

Describe the bug
How to handle CONFIRM_SIGN_IN_WITH_NEW_PASSWORD after authentication

To Reproduce
Steps to reproduce the behavior:

  1. Register new user in cognito
  2. Login new user in app
  3. Will not be able to login with result of res.nextStep.signInStep "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD"
  4. See error

Expected behavior
Cant seem to find this feature in docs

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

[RFC]: Amplify Rest API

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

We are developing the Flutter plugin category for Rest API: https://docs.amplify.aws/lib/restapi/getting-started and would like to get your comments on how this API should behave.

Flutter API

In Flutter, we propose 2 ways in which we can implement this API:

  1. Return a “RestOperation” object when calling the API. You can use this object to await for the success response and to cancel the operation.
RestOperation restOperation;

RestRequest restRequest = new RestRequest({
  restOptions: restOptions,
});

try{
  restOperation = Amplify.Api.get(restRequest);
} on Exception catch (e) {
  print(“Exception”);
}

// To get the success response await on the RestRequest's response field
RestResponse response = await restOperation.response;
// RestResponse contains the data retrieved in the HTTP operation 

// To cancel, simply call the cancel method on the RestRequest's 
restOperation.cancel();

Analysis: This approach is most similar to how our existing Flutter API plugins work for Auth and Storage which return a single result object and the error via an Exception. We recommend this approach as we believe it is similar to how other Android APIs function and should be familiar to most users.

  1. Have the input “RestRequest” object include a cancelToken field. You will use this cancelToken to cancel the operation. Return a “RestResponse” object when calling the API. This object contains the data retrieved in a successful HTTP operation.
CancelToken token = new CancelToken();

RestRequest restRequest = new RestRequest({
  restOptions: restOptions,
  cancelToken: token
});

try{
  RestResponse response = Amplify.Api.get(restRequest);
} on Exception catch (e) {
  print(“Exception”);
}

// To cancel, call the cancel method with the same token
Amplify.Api.cancel(token);

Analysis: This approach will be familiar to users of Dart’s dio (https://pub.dev/packages/dio#cancellation)package. However, we are not leaning towards this solution because we don’t want users to concern themselves with tracking and using an additional “CancelToken”.

Cannot get Cognito User Pool Tokens

Describe the bug
My project only uses Cognito User Pools, no IdentityPools, and I want to get cognito user pool tokens using:

await Amplify.Auth.fetchAuthSession(
        options: CognitoSessionOptions(getAWSCredentials: true),
);

But got error:
{localizedErrorMessage: Could not fetch identity Id, AWS Cognito Identity Pool is not configured, recoverySuggestion: Follow the steps to configure AWS Cognito Identity Pool and try again, platform: iOS}

To Reproduce
Steps to reproduce the behavior:

  1. Run this function:
Future<void> signIn(String email, String password) async {
  try {
    await Amplify.Auth.signIn(username: email, password: password);
    final resp = await Amplify.Auth.fetchAuthSession(
      options: CognitoSessionOptions(getAWSCredentials: true),
    );
    if (resp.isSignedIn) {
      final sess = resp as CognitoAuthSession;
      print(sess.userPoolTokens.accessToken);
    }
  } on AuthError catch (e) {
    print(e.cause);
    for (final exception in e.exceptionList) {
      print(exception.exception);
      print(exception.detail);
    }
  }
}

Expected behavior
Get the cognito user pool tokens without provide an Identity Pool (because I don't need it)

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

Invalid JWT Signature using Cognito JWK

Describe the bug
If we do amplify add auth and do sign in using our flutter app as described in this official AWS tutorial, we can then get our idToken from CognitoAuthSession.userPoolTokens . The problem is, when i try to verify the token using Cognito JWK as described in this official AWS docs it says invalid signature.

Side Note : I compare this behaviour with Amplify Javascript too and i don't find any problem, is there any difference between web app (reactJS) and mobile app (flutter)?

To Reproduce
Steps to reproduce the behavior:

  1. Do this AWS flutter amplify tutorial
  2. Get the idToken in CognitoAuthSession.userPoolTokens.idToken
  3. Do JWT Signature Validation using procedure in this official AWS cognito docs
  4. See error message: 'invalid signature'

Expected behavior
No error, valid signature.
image

Screenshots
Invalid signature.
image

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducable in :
[v] Android
[v] iOS

Smartphone :

  • Device: Pixel_2_API_28 Emulator, iOS Simulator
  • OS: Android 9 (Pie), iOS 12
  • Browser Google Chrome
  • Version 85

Additional context
I use Flutter Ampliy with Hasura that is deployed in AWS Elastic Beanstalk. I hope i don't need to migrate from cognito to auth0 / firebase.
Region : ap-southeast-1

Thank you

[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.

[Analytics] Recorded events not showing in Pinpoint

Describe the bug
Hi, I've implemented Amplify Analytics next to the Firebase Analytics already in place in my current app.
Everything compiles and seems to work as expected on the mobile devices (both iOS and Android), but the analytics events recorded do not end up in the Pinpoint Console after waiting for > 12 hours, even when forcing a flush - again on both platforms.

I also don't seen any errors or issues in Logcat or xcode when recording the analytics event, so I'm not sure what the cause is.

To Reproduce
Init Amplify as documented (with amplifyconfig pointing to the amplifyconfig.dart generated by the Amplify CLI).
This is done during the splash screen of the app so it's configured as we finish loading into the actual app.

initAmplify() async {
    // Add Pinpoint and Cognito Plugins
    AmplifyAnalyticsPinpoint analyticsPlugin = AmplifyAnalyticsPinpoint();
    AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
    amplifyInstance.addPlugin(
      analyticsPlugins: [analyticsPlugin],
      authPlugins: [authPlugin],
    );

    await amplifyInstance.configure(amplifyconfig);
  }

Recording a test event on a button press:

FlatButton(
    child: const Text('Amplify Log test_event'),
    onPressed: () async {
        AnalyticsEvent event = AnalyticsEvent('test_event');
        event.properties.addStringProperty('string', 'string');
        event.properties.addBoolProperty('bool', true);
        event.properties.addIntProperty('int', 42);
        event.properties.addDoubleProperty('double', 42.0);
        await Amplify.Analytics.recordEvent(event: event);
    },
),

Like the documentation specifies, the Auth Cognito plugin is added as well.
But as I'm not using Auth (yet), other than adding the plugin it is not touched in code.

As for the backend setup, everything seems to be in place on the AWS Amplify Console by having used amplify add analytics (which automatically added auth), and amplify push.

I've also tried doing amplify add auth first, and updating it afterwards by amplify add analytics, but that didn't seem to change anything (other than the auth setup having a project-specific name).

Expected behavior
Following the documentation for Analytics and recording an event should have it show up in the Pinpoint Console after a few minutes.

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

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

Smartphone (please complete the following information):

  • Device: iPhone6, Pixel 4
  • OS: iOS 12.4.7, Android 11 Preview

Is there anything I'm missing from the documentation or is a delay of multiple hours expected?

Thanks!

Uploading using the S3 storage plugin gives a cryptic error message if file does not exist

Describe the bug
When uploading a file which doesn't exist using the S3 Storage Plugin an exception is thrown.

The error message gives no indication that the file does not exist on the device and is a very cumbersome to figure out what went wrong.

To Reproduce

final File file = File("this_file_does_not.exist");
final Map<String, String> metadata = <String, String>{};
metadata["name"] = "this_file_does_not.exist";

final S3UploadFileOptions options = S3UploadFileOptions(accessLevel: StorageAccessLevel.guest, metadata: metadata);
final UploadFileResult result = await Amplify.Storage.uploadFile(key: "this_file_does_not.exist", local: file, options: options);

Exception in the Dart stack

Unhandled Exception: PlatformException(AmplifyException, UPLOAD_FILE_OPERATION_FAILED, {PLATFORM_EXCEPTIONS: {
platform: Android, 
localizedErrorMessage: Issue uploading file., 
recoverySuggestion: See included exception for more details and suggestions to fix.
}})
AmplifyStorageS3MethodChannel.uploadFile (package:amplify_storage_s3/method_channel_storage_s3.dart:41:7)
<asynchronous suspension>
AmplifyStorageS3.uploadFile (package:amplify_storage_s3/amplify_storage_s3.dart:44:22)

I couldn't see any additional information or Exceptions in the stack trace on the Dart side.

With further digging I found the error originates on the Android side of the plugin in AmplifyStorageOperations.uploadFile(). This function throws away the cause of the exception and returns an uninformative wrapper AmplifyException

Amplify.Storage.uploadFile(
...
  { error ->
      if (!responseSent) {
          responseSent = true
          prepareError(flutterResult, FlutterStorageErrorMessage.UPLOAD_FILE_OPERATION_FAILED.name, error.localizedMessage, error.recoverySuggestion)
      } else {
          LOG.error(FlutterStorageErrorMessage.UPLOAD_FILE_OPERATION_FAILED.name, error)
      }
  }
)
...

Expected behavior

A useful error message is returned.

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

PlatformException(AmplifyException, Failed to Configure Amplify, The operation couldn’t be completed. (Amplify.PluginError error 2.), null)

I have setup amplify for flutter. its currently working for Android but for iOS it just fails to configure.
In android I can already use SignIn, SignUp, Signout, etc..
however in iOS, it just logs in this error.

flutter: PlatformException(AmplifyException, Failed to Configure Amplify, The operation couldn’t be completed. (Amplify.PluginError error 2.), null)

To Reproduce
Just configure AWS Amplify for Flutter like in the docs.

Expected behavior
It should work for iOS

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

Smartphone (please complete the following information):

  • Device: iPhone8 simulator

Signing in without calling signing out does not work in ios but works in android

Describe the bug
Should work or should not work for both android and ios to maintain uniformity

To Reproduce
Steps to reproduce the behavior:

  1. run example in android and ios
  2. remove Amplify.Auth.signOut code before Amplify.Auth.signIn. run (will work in android. will fail in ios)
  3. See error

Expected behavior
Should work/not work in both android and ios

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

Smartphone (please complete the following information):

  • Device: iPhone SE
  • OS: iOS 13.6

Additional context

void _signIn() async {
    // Sign out before in case a user is already signed in
    // If a user is already signed in - Amplify.Auth.signIn will throw an exception

    // Removing this code. Amplify.Auth.signIn will throw error in iOS but not in Android
    try {
      await Amplify.Auth.signOut();
    } on AuthError catch (e) {
      print(e);
    }
    // Removing this code. Amplify.Auth.signIn will throw error in iOS but not in Android

    try {
      SignInResult res = await Amplify.Auth.signIn(
          username: usernameController.text.trim(),
          password: passwordController.text.trim());
      Navigator.pop(context, true);
    } on AuthError catch (e) {
      setState(() {
        _signUpError = e.cause;
        _signUpExceptions.clear();
        e.exceptionList.forEach((el) {
          _signUpExceptions.add(el.exception);
        });
      });
    }
  }

error thrown

flutter: Instance of 'AuthError'
flutter: AMPLIFY_SIGNIN_FAILED
flutter: PLATFORM_EXCEPTIONS
flutter: INVALID_STATE

AmplifyException, Error casting configuration map, Unsupported value: org.json.JSONException: No value for pinpointAnalytics, null

Describe the bug
After trying to call configure, app crashes with exception.

To Reproduce
init block

 Amplify amplify = Amplify();
    AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
    AmplifyAnalyticsPinpoint amplifyAnalyticsPinpoint = AmplifyAnalyticsPinpoint();
    amplify.addPlugin(authPlugins: [authPlugin]);
    amplify.addPlugin(analyticsPlugins: [amplifyAnalyticsPinpoint]);

    print('hi');
    await amplify.configure(amplifyconfig);
  1. Run the code upon app startup;
  2. It will throw
E/flutter ( 8525): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(AmplifyException, Error casting configuration map, Unsupported value: org.json.JSONException: No value for pinpointAnalytics, null)
E/flutter ( 8525): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
E/flutter ( 8525): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 8525): #3      MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
E/flutter ( 8525): #4      Amplify.configure (package:amplify_core/amplify_core.dart:71:35)
E/flutter ( 8525): #5      AwsAmplifyService.init (package:fluid/services/aws_amplify_service.dart:23:19)
E/flutter ( 8525): #6      _FluidAppState._initServices (package:fluid/main/main.dart:84:47)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #7      _FluidAppState.initState (package:fluid/main/main.dart:51:5)
E/flutter ( 8525): #8      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4812:57)
E/flutter ( 8525): #9      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #11     Element.updateChild (package:flutter/src/widgets/framework.dart:3380:18)
E/flutter ( 8525): #12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #13     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #14     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4654:5)
E/flutter ( 8525): #15     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3377:20)
E/flutter ( 8525): #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #19     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4847:11)
E/flutter ( 8525): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #21     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2777:33)
E/flutter ( 8525): #22     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:906:21)
E/flutter ( 8525): #23     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:309:5)
E/flutter ( 8525): #24     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
E/flutter ( 8525): #25     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1055:9)
E/flutter ( 8525): #26     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:971:5)
E/flutter ( 8525): #27     _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 8525): #28     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8525): #29     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 8525): #30     _invoke (dart:ui/hooks.dart:251:10)
E/flutter ( 8525): #31     _drawFrame (dart:ui/hooks.dart:209:3)

Expected behavior
App should be launched and configured properly.

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):
[x] Android
[] iOS

Smartphone (please complete the following information):
OnePlus6

Additional context
amplifyconfiguration.dart is left untouched - it was purely autogenerated.

Desktop Support for amplify-flutter

It's great to see Amplify brought to Flutter. The attractiveness of the framework is the ability to run almost anywhere. When might we see amplify-flutter working on desktop (Ubuntu and macOS)?

Can not distinguish Amplify is already configured

Describe the bug
Amplify has prevented configuration be initiated twice, but there is still no way for programmers to distinguish whether the
configs has been initialed.

Expected behavior
I've noticed that Amplify has handled a flag _isConfigured in the core class, maybe we could provide a way to check whether the configs has been initialed such like:

  bool isConfigured() {
    return _isConfigured;
  }

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

Additional context
Add any other context about the problem here.

Build failed: can't run example project in ios

Describe the bug
Cant run example project in ios. build failed
Note: project is running in android. able to login and s3 is working.

To Reproduce
Steps to reproduce the behavior:

  1. use example project
  2. add amplifyconfiguration.json manually
  3. remove pinpoint (also commented all pinpoint code). pub get. flutter clean
  4. pod install. flutter clean
  5. run in ios simulator

Expected behavior
Should be able to run in ios

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

Smartphone (please complete the following information):

  • Device: iPhone8
  • OS: iOS 13.3
    Additional context

amplifyconfiguration.json

const amplifyconfig = ''' {
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "ap-southeast-1:---",
                            "Region": "ap-southeast-1"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "ap-southeast-1_---",
                        "AppClientId": "---",
                        "AppClientSecret": "---",
                        "Region": "ap-southeast-1"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                }
            }
        }
    },
    "storage": {
        "plugins": {
            "awsS3StoragePlugin": {
                "bucket": "---",
                "region": "ap-southeast-1",
                "defaultAccessLevel": "guest"
            }
        }
    }
}''';

stack trace

Running "flutter pub get" in example...
Launching lib/main.dart on iPhone 8 Plus in debug mode...
Running pod install...
Warning: Podfile is out of date
  This can cause issues if your application depends on plugins that do not support iOS.
  See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details.
  If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.
To regenerate the Podfile, run:
  rm ios/Podfile

Running Xcode build...
Xcode build done.                                           29.0s
Failed to build iOS app
Could not build the application for the simulator.
Error launching application on iPhone 8 Plus.
Error output from Xcode build:
↳
** BUILD FAILED **


Xcode's output:
↳
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/API/Operation/AmplifyOperation+APIPublishers.swift:16:9: error: declaration 'resultPublisher' cannot override more than one superclass declaration
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/API/Operation/AmplifyOperation+APIPublishers.swift:103:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:90:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:104:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:118:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:132:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:146:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:160:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:174:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:188:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:202:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:216:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:230:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:244:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:258:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:272:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:68:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:82:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:96:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:21:9: error: declaration 'resultPublisher' cannot override more than one superclass declaration
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/API/Operation/AmplifyOperation+APIPublishers.swift:103:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:90:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:104:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:118:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:132:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:146:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:160:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:174:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:188:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:202:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:216:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:230:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:244:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:258:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:272:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:68:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:82:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:96:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:45:9: error: declaration 'resultPublisher' cannot override more than one superclass declaration
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/API/Operation/AmplifyOperation+APIPublishers.swift:103:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:90:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:104:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:118:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:132:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:146:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:160:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:174:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:188:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:202:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:216:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:230:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:244:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:258:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Auth/Operation/AmplifyOperation+AuthPublishers.swift:272:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:20:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:34:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:48:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:62:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Predictions/Operation/AmplifyOperation+PredictionsPublishers.swift:76:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:68:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:82:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:96:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:111:9: error: overriding declarations in extensions is not supported
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:96:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:135:9: error: overriding declarations in extensions is not supported
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/Amplify/Amplify/Categories/Storage/Operation/Operation+StoragePublishers.swift:96:9: note: overridden declaration is here
    var resultPublisher: AnyPublisher<Success, Failure> {
        ^
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
Command CompileSwift failed with a nonzero exit code
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/AWSS3/AWSS3/AWSS3TransferManager.m:68:17: warning: implementing deprecated class [-Wdeprecated-implementations]
@implementation AWSS3TransferManager
                ^
In file included from /Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/AWSS3/AWSS3/AWSS3TransferManager.m:16:
In file included from /Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/AWSS3/AWSS3/AWSS3.h:43:
/Users/danieltan/Downloads/amplify-flutter-master/example/ios/Pods/AWSS3/AWSS3/AWSS3TransferManager.h:54:12: note: class declared here
@interface AWSS3TransferManager : AWSService
           ^
1 warning generated.
note: Using new build system
note: Planning build
note: Constructing build description


Unhandled Exception: MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/core)

Describe the bug
Application crashes on Android when trying to configure Amplify with the following error:

E/flutter (15062): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/core)
E/flutter (15062): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
E/flutter (15062):
E/flutter (15062): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
E/flutter (15062): #2 MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
E/flutter (15062): #3 Amplify.configure (package:amplify_core/amplify_core.dart:71:35)

To Reproduce
Steps to reproduce the behavior:

  1. Configure Amplify with AmplifyAuthCognito plugin
    final amplifyInstance = Amplify(); final authPlugin = AmplifyAuthCognito(); await amplifyInstance.addPlugin(authPlugins: [authPlugin]); await amplifyInstance.configure(amplifyconfig);
  2. Application crashes

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

Flutter 1.20.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision bbfbf1770c (4 weeks ago) • 2020-08-13 08:33:09 -0700
Engine • revision 9d5b21729f
Tools • Dart 2.9.1

Platform exception when initializing

Describe the bug
When running the app
await amplifyInstance.configure(amplifyconfig);
raises this error:
PlatformException (PlatformException(AmplifyException, Failed to Configure Amplify, The operation couldn’t be completed. (Amplify.PluginError error 2.), null))
To Reproduce
Steps to reproduce the behavior:

  1. Follow docs starting here: https://docs.amplify.aws/lib/project-setup/create-application/q/platform/flutter
  2. Run app.
  3. Raise exception.

Expected behavior
App to complete configuration error free
amplifyconfiguration.dart created without issues

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

Smartphone (please complete the following information):

  • Device: Simulator 11 Pro
  • OS: iOS 13.6

Additional context
pubspec.yaml:

amplify_core: '<1.0.0'
amplify_auth_cognito: '<1.0.0'
amplify_storage_s3: '<1.0.0'
amplify_analytics_pinpoint: '<1.0.0'

main.dart:

imports...
(in app state)

Amplify amplifyInstance = Amplify();
 @override
 void initState() {
   super.initState();
   _configureAmplify();
 }

 void _configureAmplify() async {
   AmplifyAnalyticsPinpoint analyticsPlugin = AmplifyAnalyticsPinpoint();
   AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
   amplifyInstance.addPlugin(authPlugins: [authPlugin]);
   amplifyInstance.addPlugin(analyticsPlugins: [analyticsPlugin]);
   await amplifyInstance.configure(amplifyconfig);//<-- Error Here!!
 }

amplifyconfiguration.dart:

const amplifyconfig = ''' {
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "UserAgent": "aws-amplify-cli/0.1.0",
                "Version": "0.1.0",
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "...",
                            "Region": "us-east-1"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "us-east-1_BIv5TRO9E",
                        "AppClientId": "...",
                        "AppClientSecret": "...",
                        "Region": "us-east-1"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                },
                "PinpointAnalytics": {
                    "Default": {
                        "AppId": "...",
                        "Region": "us-east-1"
                    }
                },
                "PinpointTargeting": {
                    "Default": {
                        "Region": "us-east-1"
                    }
                }
            }
        }
    },
    "analytics": {
        "plugins": {
            "awsPinpointAnalyticsPlugin": {
                "pinpointAnalytics": {
                    "appId": "...",
                    "region": "us-east-1"
                },
                "pinpointTargeting": {
                    "region": "us-east-1"
                }
            }
        }
    }
}''';

resendSignUpCode throws Error but sends Code

Describe the bug
I used the resendSignUpCode function from Amplify.Auth, then it throws an Error, but i receive an E-Mail with a new Verification Link.
Exception:


cause:"ERROR_FORMATTING_PLATFORM_CHANNEL_RESPONSE"
exceptionList:List (1 item)
[0]:AuthException
detail:"codeDeliveryDetails malformed"
exception:"resendSignUpCode failed"
hashCode:255155121
runtimeType:Type (AuthException)
hashCode:519294247
runtimeType:Type (AuthError)

MyCode:

  Future<bool> resendSignUpMessage(String email) async {
    try {
      ResendSignUpCodeResult res =
          await Amplify.Auth.resendSignUpCode(username: email);
      return true;
    } catch (e, s) {
      printErrorStack(e.exceptionList, s);
      return false;
    }
  }

Expected behavior
Not throwing an Error, if there is none

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

Redeclaration: AuthCognito Error when implementing Storage

Added the following code to a working app with Auth/Storage/Analytics configured in main.dart. Have a camera.dart stateless widget that displays a photo taken with the camera. Then an upload button to upload the file (code pulled from docs). Receiving an error on compilation flutter run now:

e: /Users/michael/workspace/amplify-flutter/packages/amplify_auth_cognito/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt: (75, 14): Redeclaration: AuthCognito
e: /Users/michael/workspace/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.0.1-dev.2/android/src/main/kotlin/com/amazonaws/amplify/amplify_auth_cognito/AuthCognito.kt: (74, 14): Redeclaration: AuthCognito

Code that was added that caused the error to camera.dart file (Amplify is configured in main.dart:

var key = new DateTime.now().toString();
          Map<String, String> metadata = <String, String>{};
          metadata['name'] = 'flutter-amplify-$key';
          metadata['desc'] = 'Uploaded with Amplify for Flutter';
          S3UploadFileOptions options = S3UploadFileOptions(accessLevel: StorageAccessLevel.protected, metadata: metadata);
          try {
            File local = File(this.imagePath);
            Amplify.Storage.uploadFile(key: key, local: local, options: options)
              .then((UploadFileResult result) {
                _toast(context, "Upload Complete");
                Navigator.pop(context);
              }).catchError((error) {
                _toast(context, "Upload Failed");
                Navigator.pop(context);
                print(error);
              });
          } catch (e) {

          }

Amplify push not working with flutter when using a REST api?

Describe the bug

amplify push cannot publish an api when using flutter, it seems

Creating API models...
✖ An error occurred when pushing the resources to the cloud

Unsupported framework. flutter
An error occurred during the push operation: Unsupported framework. flutter

Amplify CLI Version

4.29.4

To Reproduce

  • install experimental flutter cli
  • create s3 storage
  • create a python function
  • create a rest api to execute the python function
  • amplify push --yes runs, and in the end fails with the error described above

Desktop (please complete the following information):

  • OS: Mac
  • Node Version. v14.4.0

Setting up a Flutter project

Which Category is your question related to?
CLI (amplify init)

Amplify CLI Version
4.27.2

What AWS Services are you utilizing?
Amplify

Provide additional details e.g. code snippets
Screen Shot 2020-08-19 at 11 21 22 AM
(There are no other options below javascript in the drop down menu at the bottom of the screenshot.)

I'm trying to setup my flutter app repo to use the developer preview of amplify-flutter. However, when I run amplify init there is no option to select a flutter app like there is in the tutorial. Am I not using the CLI correctly, am I not using the correct version of the CLI, is this a bug in the CLI, or is this not yet supported in the CLI? If the last case is true, then how should I set up a Flutter project to work with the developer preview of amplify-flutter?

iOS: Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211

Describe the bug
iOS app crash when logging in

Expected behavior
Should be able to login

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

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: iOS 13.3

Additional context
Add any other context about the problem here.

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file 
<project location>Pods/AWSMobileClient/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClientExtensions.swift, line 211

Same project run in android is working

dependencies:
...
  amplify_core: '<1.0.0'
  amplify_auth_cognito: '<1.0.0'
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "ap-southeast-1:---",
                            "Region": "ap-southeast-1"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "ap-southeast-1_---",
                        "AppClientId": "---",
                        "AppClientSecret": "---",
                        "Region": "ap-southeast-1"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH"
                    }
                }
            }
        }
    }
}''';

Running app second time, cannot configure amplify (User-Agent is configured internally during Amplify configuration. This method should not be called externally)

Describe the bug
Running app second time, it throws exception

To Reproduce

  1. Launch the app first time - error received here #142
  2. Launch app second time - another error is visible
E/flutter ( 8525): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(AmplifyException, User-Agent was already configured successfully., {cause: null, recoverySuggestion: User-Agent is configured internally during Amplify configuration. This method should not be called externally.}, null)
E/flutter ( 8525): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:582:7)
E/flutter ( 8525): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 8525): #3      MethodChannelAmplifyCore.configure (package:amplify_core_plugin_interface/method_channel_amplify.dart:25:21)
E/flutter ( 8525): #4      Amplify.configure (package:amplify_core/amplify_core.dart:71:35)
E/flutter ( 8525): #5      AwsAmplifyService.init (package:fluid/services/aws_amplify_service.dart:23:19)
E/flutter ( 8525): #6      _FluidAppState._initServices (package:fluid/main/main.dart:84:47)
E/flutter ( 8525): <asynchronous suspension>
E/flutter ( 8525): #7      _FluidAppState.initState (package:fluid/main/main.dart:51:5)
E/flutter ( 8525): #8      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4812:57)
E/flutter ( 8525): #9      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #10     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #11     Element.updateChild (package:flutter/src/widgets/framework.dart:3380:18)
E/flutter ( 8525): #12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #13     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #14     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4654:5)
E/flutter ( 8525): #15     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4649:5)
E/flutter ( 8525): #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3615:14)
E/flutter ( 8525): #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3377:20)
E/flutter ( 8525): #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4700:16)
E/flutter ( 8525): #19     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4847:11)
E/flutter ( 8525): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4369:5)
E/flutter ( 8525): #21     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2777:33)
E/flutter ( 8525): #22     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:906:21)
E/flutter ( 8525): #23     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:309:5)
E/flutter ( 8525): #24     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15)
E/flutter ( 8525): #25     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1055:9)
E/flutter ( 8525): #26     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:971:5)
E/flutter ( 8525): #27     _rootRun (dart:async/zone.dart:1190:13)
E/flutter ( 8525): #28     _CustomZone.run (dart:async/zone.dart:1093:19)
E/flutter ( 8525): #29     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
E/flutter ( 8525): #30     _invoke (dart:ui/hooks.dart:251:10)
E/flutter ( 8525): #31     _drawFrame (dart:ui/hooks.dart:209:3)

Expected behavior
App should be launched without any issues

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):
[x] Android
[] iOS

Smartphone (please complete the following information):
OnePlus6

Additional context
It should be possible to check, if AWS is already configured by a public variable. Currently, _isConfigured in Amplify() is private.

Amplify Auth - Example App - Android Exceptions

Describe the bug

When running the example app within the Amplify Auth category of this repo, when clicking on the "configure" "get user details" and "sign out" buttons, etc. within an Android Emulator device, I get Android Exceptions.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Auth category's example app
  2. Run the example app
  3. Click on the configure button and other buttons in the sample app
  4. The app will run fine, but if you look in the logs, you will see Android exceptions

Expected behavior
No exceptions thrown.

Screenshots
Here's the exception:

W/AWSMobileClient(26440): Could not check if ACCESS_NETWORK_STATE permission is available.
W/AWSMobileClient(26440): java.lang.ClassNotFoundException: android.support.v4.content.ContextCompat
W/AWSMobileClient(26440): 	at java.lang.Class.classForName(Native Method)
W/AWSMobileClient(26440): 	at java.lang.Class.forName(Class.java:454)
W/AWSMobileClient(26440): 	at java.lang.Class.forName(Class.java:379)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.AWSMobileClient.isNetworkAvailable(AWSMobileClient.java:771)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.AWSMobileClient.getUserStateDetails(AWSMobileClient.java:983)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.AWSMobileClient.signOut(AWSMobileClient.java:1483)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.AWSMobileClient$9.run(AWSMobileClient.java:1569)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.AWSMobileClient$9.run(AWSMobileClient.java:1520)
W/AWSMobileClient(26440): 	at com.amazonaws.mobile.client.internal.ReturningRunnable$1.run(ReturningRunnable.java:44)
W/AWSMobileClient(26440): 	at java.lang.Thread.run(Thread.java:923)
W/AWSMobileClient(26440): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.ContextCompat" on path: DexPathList[[zip file "/data/app/~~RRTqeS4ojfhaUqv3RaTVUw==/com.amazonaws.amplify.amplify_auth_cognito_example-r609kCpBPJWQBa3tcJHOuQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~RRTqeS4ojfhaUqv3RaTVUw==/com.amazonaws.amplify.amplify_auth_cognito_example-r609kCpBPJWQBa3tcJHOuQ==/lib/x86, /data/app/~~RRTqeS4ojfhaUqv3RaTVUw==/com.amazonaws.amplify.amplify_auth_cognito_example-r609kCpBPJWQBa3tcJHOuQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
W/AWSMobileClient(26440): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
W/AWSMobileClient(26440): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
W/AWSMobileClient(26440): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
W/AWSMobileClient(26440): 	... 10 more
I/flutter (26440): USER IS SIGNED OUT
E/Surface (26440): getSlotFromBufferLocked: unknown buffer: 0x0

Platform
Amplify-Flutter only on Android

Smartphone (please complete the following information):
Android Emulator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.