当我添加这两个库时,我的应用无法运行,它仅显示关闭应用对话框
image_picker: 0.4.12+1 #^0.5.0+3
flutter_firebase_ui: ^0.0.13
registerResGeneratingTask已弃用,请使用 registerGeneratedResFolders(FileCollection)registerResGeneratingTask 弃用,请使用registerGeneratedResFolders(FileCollection) registerResGeneratingTask已弃用,请使用 registerGeneratedResFolders(FileCollection)registerResGeneratingTask 弃用,请使用registerGeneratedResFolders(FileCollection) registerResGeneratingTask已弃用,请使用 registerGeneratedResFolders(FileCollection)内置 build / app / outputs / apk / debug / app-debug.apk。颤振需要更长的时间 超出了预期,将报告其观点。仍在尝试...
删除flutter_firebase_ui: ^0.0.13
后,我的应用程序运行正常
但是在我的其他项目中,我正在使用flutter_firebase_ui: ^0.0.13
没有
image_picker: 0.4.12+1 #^0.5.0+3
,它工作正常。
问题是什么?
Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /home/midhilaj/.pub-cache/git/flutter_twitter_login-b28bcb56f7f86319a966dcf3a08543de358b1424/android/src/main/java/com/roughike/fluttertwitterlogin/fluttertwitterlogin/TwitterLoginPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
当我删除flutter_firebase_ui时:^ 0.0.13应用程序正常工作
Launching lib/main.dart on Lenovo K8 Plus in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/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
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/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
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:706: error: cannot find symbol
private void reportException(Result result, @Nullable Exception exception) {
^
symbol: class Nullable
location: class FirebaseAuthPlugin
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:610: error: cannot find symbol
public void onComplete(@NonNull Task<AuthResult> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.SignInCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:629: error: cannot find symbol
public void onComplete(@NonNull Task<Void> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.TaskVoidCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:647: error: cannot find symbol
public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {
^
symbol: class NonNull
location: class FirebaseAuthPlugin.GetSignInMethodsCompleteListener
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:187: error: cannot find symbol
public void onComplete(@NonNull Task<AuthResult> task) {
^
symbol: class NonNull
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:492: error: cannot find symbol
public void onComplete(@NonNull Task<GetTokenResult> task) {
^
symbol: class NonNull
/home/midhilaj/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.8.1+4/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java:559: error: cannot find symbol
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
^
symbol: class NonNull
9 errors
*********************************************************
WARNING: This version of firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
See "shorturl" for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
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 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
答案 0 :(得分:2)
您需要选择与androidX兼容的版本 看到此链接:URL
您应该使用firebase_auth:0.7.0
答案 1 :(得分:1)
通过在AndroidManifest.xml中添加Facebook应用ID来解决的问题
尝试在Android Studio中运行Android应用会收到错误消息
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="adasdsa"/>