Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
adasiewiczr opened this issue Sep 7, 2020 · 6 comments
Labels
core Issues related to the Amplify Core Plugin Documentation Improvements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes). good first issue Good for newcomers to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided

Comments

@adasiewiczr
Copy link

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

@fjnoyp
Copy link
Contributor

fjnoyp commented Sep 7, 2020

Hi @adasiewiczr did you setup Auth with the Amplify CLI?

@adasiewiczr
Copy link
Author

@fjnoyp I've provided configuration manually. It seems that for some reason plugin isn't registered

@fjnoyp
Copy link
Contributor

fjnoyp commented Sep 7, 2020

Hi @adasiewiczr

If you add a plugin (like Auth) without configuring it properly in amplifyconfiguration.dart, the configure step can cause crashes like in your case.

When creating your amplifyconfiguration.dart file, did you follow the instructions here?
https://docs.amplify.aws/lib/auth/existing-resources/q/platform/flutter

Also, can you do a "flutter clean" before rerunning your application?

@adasiewiczr
Copy link
Author

Hi @fjnoyp
yes, I followed those instructions and I tried to run flutter clean before rerunning the app and it doesn't change anything :(
Here you can find my config file:

const amplifyconfig = '''{
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"IdentityManager": {
"Default": {}
},
"CognitoUserPool": {
"Default": {
"PoolId": "ap-xxxxx,
"AppClientId": “xxxxx”,
"Region": "ap-xxxx”
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_PASSWORD_AUTH"
}
}
}
}
}
}''';

@Ashish-Nanda Ashish-Nanda added to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided investigating core Issues related to the Amplify Core Plugin labels Sep 8, 2020
@adasiewiczr
Copy link
Author

@fjnoyp I've resolved the problem so the issue can be closed. I found out that my project was using an old Android wrapper and I had to migrate it to the newer version - https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

@fjnoyp fjnoyp added Documentation Improvements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes). good first issue Good for newcomers labels Sep 8, 2020
@fjnoyp
Copy link
Contributor

fjnoyp commented Sep 8, 2020

Hi @adasiewiczr thanks for sharing that with us. We'll update our documentation to help other users that might encounter this problem as well.

@fjnoyp fjnoyp closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues related to the Amplify Core Plugin Documentation Improvements or fixes to public documentation (docs.amplify.aws, pub.dev, readmes). good first issue Good for newcomers to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided
Projects
None yet
Development

No branches or pull requests

3 participants