我正在开发一个使用firebase_auth和firebase_database插件的Flutter应用程序,一切正常,直到最近它失败并出现以下错误:
E/StorageHelpers(16377): Failed to turn object into JSON
E/StorageHelpers(16377): java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.google.firebase.auth.internal.zzm.zzbf()' on a null object reference
E/StorageHelpers(16377): at com.google.firebase.auth.internal.zzz.zzi(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.internal.zzz.zzg(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.FirebaseAuth$zza.zza(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.api.internal.zzbq.zzaa(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.api.internal.zzcy.zzal(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.api.internal.zzcy.zza(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.api.internal.zzdb.zza(Unknown Source)
E/StorageHelpers(16377): at com.google.firebase.auth.api.internal.zzci.dispatchTransaction(Unknown Source)
E/StorageHelpers(16377): at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source)
E/StorageHelpers(16377): at android.os.Binder.execTransact(Binder.java:565)
W/Binder (16377): Binder call failed.
我只是不知道这个问题已经阻止了我的开发进度一段时间,它发生在我的Android设备(LG V20)和模拟器上。任何帮助将不胜感激。
这是Flutter Doctor命令的输出:
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.11.6 15G19009, locale en)
• Flutter version 0.4.4 at /Volumes/OSX_DATA/Users/jimmy/documents/development/FLutter/flutter
• Framework revision f9bb4289e9 (5 weeks ago), 2018-05-11 21:44:54 -0700
• Engine revision 06afdfe54e
• Dart version 2.0.0-dev.54.0.flutter-46ab040e58
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.0-rc2)
• Android SDK at /Volumes/OSX_DATA/Users/jimmy/Library/Android/sdk
• Android NDK at /Volumes/OSX_DATA/Users/jimmy/Library/Android/sdk/ndk-bundle
• Platform android-28, build-tools 28.0.0-rc2
• ANDROID_HOME = /Volumes/OSX_DATA/Users/jimmy/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[!] iOS toolchain - develop for iOS devices (Xcode 8.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 8.2.1, Build version 8C1002
✗ Flutter requires a minimum Xcode version of 9.0.0.
Download the latest version or update via the Mac App Store.
• ios-deploy 1.9.2
! CocoaPods out of date (1.5.0 is recommended).
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To upgrade:
brew upgrade cocoapods
pod setup
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Community Edition (version 2018.1.4)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 25.0.2
• Dart plugin version 181.4892.1
[✓] Connected devices (1 available)
• LG H990 • LGH9904548262d • android-arm64 • Android 7.0 (API 24)
这里的iOS问题应该没有问题。
我正在使用Dark SDK 1.24.3,Firebase插件版本如下:
firebase_analytics: ^1.0.1
firebase_auth: ^0.5.11
firebase_database: ^1.0.1
firebase_storage: ^0.3.7
firebase_admob: ^0.5.5
谢谢和问候,
麦