1
votes

I have been following the Firebase for Flutter tutorial with success until I reach "Set up Firebase Integration". When I relaunch the app on my phone the build fails with the following exception:

Note: /Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.0.2/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. /Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:30: error: cannot find symbol import io.flutter.app.FlutterFragmentActivity; ^ symbol: class FlutterFragmentActivity location: package io.flutter.app /Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:98: error: cannot find symbol + FlutterFragmentActivity.class.getName()); ^ symbol: class FlutterFragmentActivity location: class GoogleSignInPlugin 2 errors

FAILURE: Build failed with an exception.

Flutter doctor says everything is fine for Android. I have the latest "everything". I was able to setup the google-services json file and use the Firebase console with no problems.

I followed the instructions for modifying the build.gradle files exactly--twice!.

Is there some of other step I should be doing outside of the Flutter tutorial that is specific for Android, perhaps Brew or cocoapods maybe?

1

1 Answers

0
votes

It looks like you might have an older version of Flutter that doesn't match the Google Sign In plugin version you're using. Right now the plugins aren't declaring which versions of Flutter they require (but that may change in the future).

Does running flutter update get you past this error? If not, try running flutter doctor and see how old your Flutter SDK is. You want it to include the commit b4ba972bf394a2269824e1eadaa1627bbc872d4b, so it should be a few days old at most.

You should replace FlutterActivity with FlutterFragmentActivity in the two places it appears in your MainActivity.java. (This won't be necessary in the next Google Sign In plugin update; see issue 10690.)