4

I asked a similar question before, but I am having trouble with Google Sign-in after publishing my app to internal and closed testing on the Play store. It works perfectly well on emulators for both Android and iOS, works great on real devices when I run it from my computer in debug and release modes, but once published to the Play store, everything breaks. The error I get is

MissingPluginException(No implementation found for method init on channel plugins.flutter.io/google_sign_in)

Is there anything in particular I'm missing? I have a feeling this is a one-step solution and I just can't find it.

nickinspace
  • 113
  • 2
  • 9
  • I've also set up a verified OAuth Consent screen, eliminated facebook/apple sign-ins -- I just don't know what's going on. Everything works so nicely before I release to the Play Store!! – nickinspace Dec 23 '20 at 23:17

4 Answers4

9

I had the same problem as you (same error message, using Flutter, only occuring after app store) and was able to figure it out by finding an analagous problem here: https://github.com/flutter/flutter/issues/65334

I added

    buildTypes {
        release {
           minifyEnabled false
           shrinkResources false
    ...

to my build.gradle file. You can also set both of those values to true and run flutter run --release to reproduce the issue locally. When you build with flutter build appbundle it shrinks by default whereas running locally does not, that's why you aren't seeing the issue when running locally. It has something to do with the google sign in code being trimmed. This is really a workaround.

Zak
  • 127
  • 1
  • 4
  • This works -- I spent DAYS trying to figure this out. It also solved an issue where I couldn't even sign in with other Firebase Auth methods. – nickinspace Dec 31 '20 at 19:55
2

add this library in .yaml

google_sign_in: ^0.0.2

then import this in your login screen

import io.flutter.plugins.GeneratedPluginRegistrant;

then add this to the onCreate function

@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
  }
0

In my case I tried to invoke method from MainActivity, but in AndroidManifest.xml activity tag had wrong name, like this:

   "io.flutter.embedding.android.FlutterFragmentActivity"

So I changed it to

  ".MainActivity"
Sn1cKa
  • 601
  • 6
  • 11
0

I had the same Issue on react native and all I had to do was change android/app/build.gradle

    buildTypes {
    release {
       minifyEnabled true

to

    buildTypes {
    release {
       minifyEnabled false

sync and clean build before running again

Sherif Samir
  • 259
  • 3
  • 5