Skip to content

MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/amplify) #404

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

Closed
roberthelmick08 opened this issue Feb 23, 2021 · 4 comments

Comments

@roberthelmick08
Copy link

roberthelmick08 commented Feb 23, 2021

Describe the bug
When launching my app I'm receiving a MissingPluginException. I have configured Auth via the Amplify CLI using the default configurations and I can confirm that the Auth resources are pushed to the cloud. I've checked amplifyconfiguration.dart and the keys do match. The error also occurs when I start a fresh project and follow the Amplify Project Setup tutorial

I've tried lots of suggestions from GitHub and Stackoverflow including:

  • restarting the app, run flutter clean then flutter pub get
  • updating all my dependencies
  • Invalidated caches & restarted Android Studio
  • ensured widgets are initialized by calling WidgetsFlutterBinding.ensureInitialized() in main()
  • ensured I'm not calling Amplify.configure() before the Auth plugin is loaded
  • started a completely new project and reinitialized Amplify

To Reproduce
Steps to reproduce the behavior:

  1. Follow the 'Project Setup' tutorial

  2. amplify add auth (use default config), then amplify push

  3. Run project in web, iOS or Android

Expected Behavior
No errors

Current behavior

    Error: MissingPluginException(No implementation found for method configure on channel com.amazonaws.amplify/amplify)
        at Object.throw_ [as throw] (http://localhost:56261/dart_sdk.js:5331:11)
        at MethodChannel._invokeMethod (http://localhost:56261/packages/flutter/src/services/system_channels.dart.lib.js:954:21)
        at _invokeMethod.next (<anonymous>)
        at http://localhost:56261/dart_sdk.js:39029:33
        at _RootZone.runUnary (http://localhost:56261/dart_sdk.js:38886:58)
        at _FutureListener.thenAwait.handleValue (http://localhost:56261/dart_sdk.js:33872:29)
        at handleValueCallback (http://localhost:56261/dart_sdk.js:34432:49)
        at Function._propagateToListeners (http://localhost:56261/dart_sdk.js:34470:17)
        at _Future.new.[_completeWithValue] (http://localhost:56261/dart_sdk.js:34312:23)
        at async._AsyncCallbackEntry.new.callback (http://localhost:56261/dart_sdk.js:34335:35)
        at Object._microtaskLoop (http://localhost:56261/dart_sdk.js:39173:13)
        at _startMicrotaskLoop (http://localhost:56261/dart_sdk.js:39179:13)
        at http://localhost:56261/dart_sdk.js:34686:9

Platform
[x] Web
[] Android
[] iOS

Additional context
main.dart (copied directly from the tutorial)

  class _MyHomePageState extends State<MyHomePage> {
    @override
    initState() {
      super.initState();
      _configureAmplify();
    }
  
    void _configureAmplify() async {
      AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
      Amplify.addPlugin(authPlugin);
  
      try {
        await Amplify.configure(amplifyconfig); # <--- this is what throws the MissingPluginException 
      } on AmplifyAlreadyConfiguredException {
        print(
            "Tried to reconfigure Amplify; this can occur when your app restarts on Android.");
      }
    }
  ...
  }

pubspec.yaml:

name: <myproject>
description: <description>

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  amplify_flutter: '<1.0.0'
  amplify_auth_cognito: '<1.0.0'

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
@Amplifiyer
Copy link
Contributor

@roberthelmick08 Amplify-flutter currently doesn't support Web platform and it's expected to get this error when running on Web platform. Please see #234

You mentioned you are getting this error on iOS and Android, can you paste the logs here that you see from these platforms?

@roberthelmick08
Copy link
Author

Sorry, that was a typo, I am only getting the error on the web--I edited the post just now.

Are there any plans to support amplify-flutter on the web?

Also perhaps the Amplify-Flutter documentation should be updated. It reads "The open-source Amplify Framework provides the following products to build fullstack iOS, Android, Flutter, Web, and React Native apps". It would have been helpful to explicitly state that web isn't supported

@Amplifiyer
Copy link
Contributor

@roberthelmick08 We are evaluating the support for web platform in amplify-flutter library. Please +1 at #234.

Also perhaps the Amplify-Flutter documentation should be updated. It reads "The open-source Amplify Framework provides the following products to build fullstack iOS, Android, Flutter, Web, and React Native apps". It would have been helpful to explicitly state that web isn't supported

I agree that this is confusing. Amplify does support web but not from amplify-flutter library. See Amplify JavaScript
. We'll update the docs to clarify that.

@roberthelmick08
Copy link
Author

Thank you for the support, I will close the ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants