我正在开发Flutter项目,直到两周前我升级软件包的版本以使其与androidX兼容时,它的运行情况一直很好。从那时起,我遇到了一些错误,但我已经解决了,但从昨天开始,我一直陷在似乎无法解决的错误中。
现在,每当我尝试在iOS上运行该项目时,都会生成该项目,但是当它即将启动时,模拟器会冻结,并且会出现以下错误输出:
2019-04-17 13:56:20.283677+0200 Runner[21883:6267368] - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-04-17 13:56:20.294070+0200 Runner[21883:6266945] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2019-04-17 13:56:20.425242+0200 Runner[21883:6266945] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
2019-04-17 13:56:20.425387+0200 Runner[21883:6266945] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2019-04-17 13:56:20.426345+0200 Runner[21883:6266945] Configuring the default Firebase app...
2019-04-17 13:56:20.426395+0200 Runner[21883:6267384] 5.20.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2019-04-17 13:56:20.477082+0200 Runner[21883:6267383] 5.20.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50801000 started
2019-04-17 13:56:20.479725+0200 Runner[21883:6267383] 5.20.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see *url*)
2019-04-17 13:56:20.484815+0200 Runner[21883:6266945] Configured the default Firebase app __FIRAPP_DEFAULT.
2019-04-17 13:56:20.530844+0200 Runner[21883:6267409] flutter: Observatory listening on http://127.0.0.1:54881/
2019-04-17 13:56:21.026177+0200 Runner[21883:6267427] 5.20.0 - [Firebase/Core][I-COR000004] App with name (null) does not exist.
2019-04-17 13:56:21.027251+0200 Runner[21883:6267382] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fcd6740e330] get output frames failed, state 8196
2019-04-17 13:56:21.027450+0200 Runner[21883:6267382] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7fcd6740e330] get output frames failed, state 8196
2019-04-17 13:56:21.028091+0200 Runner[21883:6267382] TIC Read Status [1:0x0]: 1:57
2019-04-17 13:56:21.028235+0200 Runner[21883:6267382] TIC Read Status [1:0x0]: 1:57
2019-04-17 13:56:21.073087+0200 Runner[21883:6266945] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: 0)'
*** First throw call stack:
(
0 CoreFoundation 0x00000001151ed1bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000011478b735 objc_exception_throw + 48
2 CoreFoundation 0x00000001151394ec _CFThrowFormattedException + 194
3 CoreFoundation 0x000000011525f396 -[__NSDictionaryM setObject:forKey:] + 1046
4 Runner 0x00000001101ceb34 -[FLTFirebaseAuthPlugin handleMethodCall:result:] + 15636
5 Flutter 0x00000001118ac7ba __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 115
6 Flutter 0x00000001118c94ac _ZNK5shell21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 166
7 Flutter 0x00000001118ccff0 _ZN5shell15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 38
8 Flutter 0x000000011191fca7 _ZNSt3__110__function6__funcIZN5shell5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEEE4$_27NS_9allocatorIS9_EEFvvEEclEv + 57
9 Flutter 0x00000001118d8e0e _ZN3fml15MessageLoopImpl15RunExpiredTasksEv + 522
10 Flutter 0x00000001118dc18c _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
11 CoreFoundation 0x0000000115152f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
12 CoreFoundation 0x0000000115152b32 __CFRunLoopDoTimer + 1026
13 CoreFoundation 0x000000011515239a __CFRunLoopDoTimers + 266
14 CoreFoundation 0x000000011514ca1c __CFRunLoopRun + 2252
15 CoreFoundation 0x000000011514be11 CFRunLoopRunSpecific + 625
16 GraphicsServices 0x00000001196931dd GSEventRunModal + 62
17 UIKitCore 0x000000011dcf981d UIApplicationMain + 140
18 Runner 0x000000010fcd7c04 main + 68
19 libdyld.dylib 0x0000000116a2a575 start + 1
20 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
在我看来,这里有多个错误,但我不知道其中某些仅仅是警告还是实际错误。我认为问题/问题与firebase_auth,firebase_core或其他某些插件有关。
pubspec.yaml:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cloud_firestore: ^0.9.0
firebase_analytics: ^2.0.0
rxdart: ^0.19.0
cached_network_image: ^0.5.1
firebase_auth: ^0.8.0
intl: ^0.15.7
http: ^0.12.0
shared_preferences: ^0.4.3
share: ^0.5.3
flutter_webview_plugin: ^0.3.1
mailer: ^2.1.2
flutter_launcher_icons: ^0.7.0
package_info: ^0.4.0
flutter_circular_chart: ^0.1.0
dots_indicator: ^0.0.4
url_launcher: 4.2.0+1
webview_flutter: ^0.3.4
connectivity: ^0.4.2
vibrate: ^0.0.4
devicelocale: ^0.1.1
firebase_core: ^0.3.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
答案 0 :(得分:0)
您在那里的答案
2019-04-17 13:56:21.073087 + 0200 Runner [21883:6266945] *由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'* -[__NSDictionaryM setObject:forKey: ]:对象不能为nil(键:0)'
您尝试在字典中插入nil,而调用来自[FLTFirebaseAuthPlugin handleMethodCall:result:]
似乎找不到Firebase凭证。
答案 1 :(得分:0)
通过创建一个新的flutter项目并在其中复制所有文件来解决。
我从不知道问题出在哪里。