I recently transferred my Flutter project from one Firebase project registration to a different one. I changed the package name everywhere in my Flutter project and replaced the google-services.json file.
My issue is that whenever I Build by APK, it crashes because there are errors in the android/GeneratedPluginRegistrant.java file. My code for the file is as follows; I have pointed out the errors in the code:
package io.flutter.plugins;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
//THE FOLLOWING FOUR LINES ALL HAVE ERRORS:
io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin.registerWith(shimPluginRegistry.registrarFor("io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin"));
io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.registerWith(shimPluginRegistry.registrarFor("io.flutter.plugins.firebaseauth.FirebaseAuthPlugin"));
flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FirebaseCorePlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.googlesignin.GoogleSignInPlugin());
}
}
The errors are basically saying that they can't resolve the "firebase", "firebaseauth", and "googlesignin" packages.
My APK was building just fine before I transferred my project to a different Firebase account. How do I fix these errors? Has anyone else seen errors like this in their GeneratedPluginRegistrant.java file?