3
votes

Note: /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-3.0.2/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics-3.0.2/android/src/main/java/io/flutter/plugins/firebaseanalytics/FirebaseAnalyticsPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:9: error: cannot find symbol import androidx.annotation.NonNull; ^ symbol: class NonNull location: package androidx.annotation /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:10: error: cannot find symbol import androidx.annotation.Nullable; ^ symbol: class Nullable location: package androidx.annotation /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:764: error: cannot find symbol private void reportException(Result result, @Nullable Exception exception) { ^ symbol: class Nullable location: class FirebaseAuthPlugin /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:668: error: cannot find symbol public void onComplete(@NonNull Task task) { ^ symbol: class NonNull location: class FirebaseAuthPlugin.SignInCompleteListener /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:687: error: cannot find symbol public void onComplete(@NonNull Task task) { ^ symbol: class NonNull location: class FirebaseAuthPlugin.TaskVoidCompleteListener /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:705: error: cannot find symbol public void onComplete(@NonNull Task task) { ^ symbol: class NonNull location: class FirebaseAuthPlugin.GetSignInMethodsCompleteListener /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:540: error: cannot find symbol public void onComplete(@NonNull Task task) { ^ symbol: class NonNull /opt/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+5/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:617: error: cannot find symbol public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { ^ symbol: class NonNull 8 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':firebase_auth:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 15s


Finished with error: Gradle task assembleDebug failed with exit code 1

1
this is an android x issue. Try using a lower version of the firebase auth plugin. For more details see this flutter.dev/docs/development/packages-and-plugins/…nick.tdr

1 Answers

11
votes

This is what helped me:

  • Go to android/app/build.gradle file and change compileSdkVersion and targetSdkVersion to 28 (they were probably 27)
  • Go to android/gradle.properties file and add the following lines:
    android.useAndroidX=true android.enableJetifier=true

This will switch your app to using androidx, and in turn solve this problem.


from here:
https://github.com/flutter/flutter/issues/27090#issuecomment-457926860