我正在使用Firebase的电话号码进行身份验证,但现在在android和ios中都遇到了一些错误。
我通过更改firebase-auth
和fireabse_core
的版本解决了ios错误。
在进行此更改之前,flutter项目在Android设备上可以正常运行,但是在更改后,我在android中出现错误。
有人说,我浏览了它,然后迁移到Androidx,但是我已经按照this
进行了迁移android> android.properties:
android.enableJetifier=true
android.useAndroidX=true
这件事我已经改变了:
firebase_auth:
git:
url: https://github.com/collinjackson/plugins.git
ref: 441417c2fed0ff26bf84a49ab2c5ffd2aa5487de
path: packages/firebase_auth
pubspec.yaml:
dependencies:
flutter:
sdk: flutter
firebase_auth:
git:
url: https://github.com/collinjackson/plugins.git
ref: 441417c2fed0ff26bf84a49ab2c5ffd2aa5487de
path: packages/firebase_auth
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
flutter_launcher_icons: ^0.7.2+1
page_transition:
#firebase_auth: ^0.14.0+5
firebase_core: ^0.4.0
cloud_firestore:
fluttertoast:
shared_preferences:
swipedetector: ^1.2.0
flutter_spinning_wheel: ^1.1.0
tel_input:
country_code_picker: ^1.1.7
country_pickers: ^1.1.0
intl:
datetime_picker_formfield: ^0.1.1
flutter_share_me: ^0.5.0
image_picker:
share:
countdown: ^0.1.0
splashscreen: ^1.2.0
pin_code_text_field: ^1.3.7
flutter运行android设备的输出:
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:8: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:9: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:235: error: cannot find symbol
public void onFailure(@NonNull Exception e) {
^
symbol: class NonNull
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:256: error: cannot find symbol
public Void apply(@NonNull Transaction transaction)
^
symbol: class NonNull
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:254: error: cannot find symbol
@Nullable
^
symbol: class Nullable
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:481: error: cannot find symbol
public void onFailure(@NonNull Exception e) {
^
symbol: class NonNull
/Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java:534: error: cannot find symbol
public void onFailure(@NonNull Exception e) {
^
symbol: class NonNull
Note: /Users/sukhjinder/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.3.2/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cloud_firestore: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.
Gradle task assembleDebug failed with exit code 1