my app isn't building again, don't know what I did wrong. The error message is listed below
C:\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:9: error: package androidx.annotation does not exist
import androidx.annotation.NonNull;
^
C:\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:10: error: package androidx.annotation does not exist
import androidx.annotation.Nullable;
^
C:\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.8.0+1\android\src\main\java\io\flutter\plugins\firebaseauth\FirebaseAuthPlugin.java:638: error: cannot find symbol
Add: implementation 'androidx.annotation:annotation:1.0.1'
to the build.gradle of firebase_auth library. I used Android Studio to see the flutter android app structure.
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-auth:16.0.1'
implementation 'androidx.annotation:annotation:1.0.1'
}
}
pubspec.yaml(dependencies)
flutter:
sdk: flutter
rxdart: ^0.20.0
firebase_core: ^0.3.0
firebase_analytics: ^2.0.0
firebase_auth: ^0.8.0+1
google_sign_in: ^4.0.0
There seems to be a bug in the latest version of some of the Google plugins where they migrated to AndroidX. I've made a pull request with a fix but it likely won't be reviewed before Monday.
A workaround meanwhile is to downgrade to a working version in your pubspec. E.g. I had firebase_storage: ^1.1.0
, and after looking at the changelog to identify a previous version, I changed that line to firebase_storage: 1.0.4
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With