由于云firestore和firebase验证错误,我的Flatter应用程序不再编译
我花了好几天时间试图用Firebase调试我的应用程序。 以前它工作的很好,直到上周我更新了很多东西;android studio、Flatter、插件等。 编译后,这始终是我的结果由于云firestore和firebase验证错误,我的Flatter应用程序不再编译,firebase,flutter,google-cloud-firestore,firebase-authentication,androidx,Firebase,Flutter,Google Cloud Firestore,Firebase Authentication,Androidx,我花了好几天时间试图用Firebase调试我的应用程序。 以前它工作的很好,直到上周我更新了很多东西;android studio、Flatter、插件等。 编译后,这始终是我的结果 import android.support.annotation.NonNull; ^ /home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebas
import android.support.annotation.NonNull;
^
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:538: error: cannot find symbol
public void onComplete(@NonNull Task<AuthResult> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.SignInCompleteListener
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:558: error: cannot find symbol
public void onComplete(@NonNull Task<Void> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.TaskVoidCompleteListener
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:576: error: cannot find symbol
public void onComplete(@NonNull Task<ProviderQueryResult> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.ProvidersCompleteListener
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:175: error: cannot find symbol
public void onComplete(@NonNull Task<AuthResult> task) {
^
symbol: class NonNull
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:270: error: cannot find symbol
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
^
symbol: class NonNull
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:435: error: cannot find symbol
public void onComplete(@NonNull Task<GetTokenResult> task) {
^
symbol: class NonNull
/home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:487: error: cannot find symbol
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
^
symbol: class NonNull
Note: /home/baw/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
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 2m 48s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Exception: The plugin cloud_firestore could not be built due to the issue above.
找到解决方案
这确实是由AndroidX问题引起的,但迁移毫无帮助。
所以我用来解决这个问题的步骤是
import android.support.annotations.NonNull
)并用AndroidX导入替换它
导入androidx.annotations.NonNull
import android.support.annotations.NonNull
)并用AndroidX导入替换它
导入androidx.annotations.NonNull
就这样,祝你一切顺利 这回答了你的问题吗?不,那还不行。同样的错误这能回答你的问题吗?不,那还不行。同样的错误
[✓] Flutter (Channel beta, 1.24.0-10.2.pre, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Android Studio
[✓] Connected device (1 available)
• No issues found!```