3

I'm trying to get the google sign in plugin to work without any success. I've put it in my pubspec.yaml and ran flutter packages get but still no luck. The following exception is thrown:

E/flutter ( 3313): [ERROR:../../lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter ( 3313): MissingPluginException(No implementation found for method init on channel plugins.flutter.io/google_sign_in)

I'm working on Android. Haven't had a chance to test it for iOS yet. Any suggestions?

Bram Vanbilsen
  • 5,763
  • 12
  • 51
  • 84

1 Answers1

2

Hmm, it sounds like you are on an old version of something. First flutter upgrade.

Your MainActivity.java should look something like this:

package com.yourcompany.example;

import android.os.Bundle;

import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
}

Your pubspec.yaml should say:

dependencies:
  flutter:
    sdk: flutter
  google_sign_in: ^0.0.2

If that doesn't work, try creating a new project and copying your files and assets over.

If it still is running into that error, try running flutter doctor and add the text to your question.

Collin Jackson
  • 110,240
  • 31
  • 221
  • 152
  • I've literally been looking for some step I missed for two days and couldn't figure it out. Just upgrading worked... Thanks for saving me more days of struggling! – Bram Vanbilsen May 25 '17 at 21:15
  • 1
    I tried the above steps but still facing the same issue. @CollinJackson – Ronak Patel Oct 28 '20 at 11:14