I'm using Flutter and Firestore on my application. I decided to use the Firebase authentication library and I have just typed flutter pub add firebase_auth
on my terminal.
After running the app through flutter run
, I'm having a "bad class file" error for the following route:
build\firebase_auth\intermediates\compile_library_classes_jar\debug\classes.jar(/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.class)
The error says:
class file contains wrong class: io.flutter.plugins.firebase.core.FlutterFirebasePlugin Please remove or make sure it appears in the correct subdirectory of the classpath. 1 error FAILURE: Build failed with an exception.
I emptied the pub cache, then I removed the firebase authentication package and run the app then it worked again like a charm.
Then I added firebase_auth: ^4.2.8
into my dependencies and typed flutter pub get
, then ran the app again and I received the same error!