启动屏幕后,应用程序崩溃。我在MacBook上使用Android Studio。
以下是Android和IOS的Flutter Run日志以及Flutter Doctor和Flutter Run –verbose的详细信息
FLUTTER RUN(android):日志在最后一行之后卡住,即使一个小时后也没有任何反应。
Launching lib/main.dart on AOSP on IA Emulator in debug mode... Running Gradle task 'assembleDebug'... Note: /Users/rohitchaudhari/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.6/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /Users/rohitchaudhari/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.11/android/src/main/java/io/flutter/plugins/urllauncher/WebViewActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/rohitchaudhari/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.11+1/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/rohitchaudhari/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-0.3.22+1/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. ✓ Built build/app/outputs/apk/debug/app-debug.apk. Installing build/app/outputs/apk/app.apk...
FLUTTER RUN(IOS):日志在最后一行之后卡住,即使一个小时后也没有任何反应。
Launching lib/main.dart on iPhone 11 in debug mode... Running pod install... 19.3s Running Xcode build... Xcode build done. 949.6s *** First throw call stack: ( 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23e3cd4c +[NSException raise:format:] + 188 3 UIKitCore 0x00007fff488e2273 -[UINib instantiateWithOwner:options:] + 491 4 UIKitCore 0x00007fff488e3237 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 147 5 Flutter 0x000000011171ef53 -[FlutterViewController splashScreenFromXib:] + 66 6 Flutter <…> This is taking longer than expected...
FLUTTER DOCTOR :
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.3 19D76, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 11.5) [✓] Android Studio (version 4.0) [✓] Connected device (2 available) • No issues found!
XCODE RUN ERRORS(调试模式):
2020-06-19 17:04:50.594270+0530 Runner[28755:186463] flutter: Observatory listening on http://127.0.0.1:57856/ZA1msGYhRVI=/ 2020-06-19 17:04:50.698101+0530 Runner[28755:185769] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/rohitchaudhari/Library/Developer/CoreSimulator/Devices/E5D00A1A-5ED7-4263-8745-182DADC3A4A7/data/Containers/Bundle/Application/95E8F966-4520-44FD-BDD5-79E20450BF5B/Runner.app> (loaded)' with name 'LaunchScreen'' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23e3cd4c +[NSException raise:format:] + 188 3 UIKitCore 0x00007fff488e2273 -[UINib instantiateWithOwner:options:] + 491 4 UIKitCore 0x00007fff488e3237 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 147 5 Flutter 0x000000010e5ecf53 -[FlutterViewController splashScreenFromXib:] + 66 6 Flutter 0x000000010e5ece83 -[FlutterViewController loadDefaultSplashScreenView] + 115 7 Flutter 0x000000010e5ebdc4 -[FlutterViewController initWithProject:nibName:bundle:] + 369 8 UIKitCore 0x00007fff488e0707 -[UIClassSwapper initWithCoder:] + 2427 9 UIFoundation 0x00007fff48107274 UINibDecoderDecodeObjectForValue + 743 10 UIFoundation 0x00007fff48106f80 -[UINibDecoder decodeObjectForKey:] + 251 11 UIKitCore 0x00007fff488e499a -[UIRuntimeConnection initWithCoder:] + 125 12 UIFoundation 0x00007fff48107274 UINibDecoderDecodeObjectForValue + 743 13 UIFoundation 0x00007fff48107518 UINibDecoderDecodeObjectForValue + 1419 14 UIFoundation 0x00007fff48106f80 -[UINibDecoder decodeObjectForKey:] + 251 15 UIKitCore 0x00007fff488df7d5 -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 450 16 UIKitCore 0x00007fff488e24e8 -[UINib instantiateWithOwner:options:] + 1120 17 UIKitCore 0x00007fff48e0489f -[UIStoryboard __reallyInstantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 279 18 UIKitCore 0x00007fff48e0474a -[UIStoryboard _instantiateViewControllerWithIdentifier:creator:storyboardSegueTemplate:sender:] + 97 19 UIKitCore 0x00007fff48c8ab8d -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 167 20 UIKitCore 0x00007fff48c8b122 -[UIApplication _loadMainInterfaceFile] + 274 21 UIKitCore 0x00007fff48c89af3 -[UIApplication _runWithMainScene:transitionContext:completion:] + 964 22 UIKitCore 0x00007fff4839225d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122 23 UIKitCore 0x00007fff4889dcc1 _UIScenePerformActionsWithLifecycleActionMask + 83 24 UIKitCore 0x00007fff48392d6f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198 25 UIKitCore 0x00007fff4839277e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296 26 UIKitCore 0x00007fff48392b9c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818 27 UIKitCore 0x00007fff48392431 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345 28 UIKitCore 0x00007fff48396a22 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178 29 UIKitCore 0x00007fff487b3dad +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 852 30 UIKitCore 0x00007fff488bc41e _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240 31 UIKitCore 0x00007fff4839673d __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153 32 UIKitCore 0x00007fff488bc321 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84 33 UIKitCore 0x00007fff483965ab -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381 34 UIKitCore 0x00007fff481eafa8 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657 35 UIKitCore 0x00007fff481e9b67 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253 36 UIKitCore 0x00007fff481eacd2 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210 37 UIKitCore 0x00007fff48c88141 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 512 38 UIKitCore 0x00007fff487da8dc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361 39 FrontBoardServices 0x00007fff36cacd2e -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 419 40 FrontBoardServices 0x00007fff36cd2dc1 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102 41 FrontBoardServices 0x00007fff36cb7757 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220 42 FrontBoardServices 0x00007fff36cd2a52 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355 43 libdispatch.dylib 0x0000000112e72e8e _dispatch_client_callout + 8 44 libdispatch.dylib 0x0000000112e75da2 _dispatch_block_invoke_direct + 300 45 FrontBoardServices 0x00007fff36cf86e9 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 46 FrontBoardServices 0x00007fff36cf83d7 -[FBSSerialQueue _queue_performNextIfPossible] + 441 47 FrontBoardServices 0x00007fff36cf88e6 -[FBSSerialQueue _performNextFromRunLoopSource] + 22 48 CoreFoundation 0x00007fff23da0d31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 49 CoreFoundation 0x00007fff23da0c5c __CFRunLoopDoSource0 + 76 50 CoreFoundation 0x00007fff23da0434 __CFRunLoopDoSources0 + 180 51 CoreFoundation 0x00007fff23d9b02e __CFRunLoopRun + 974 52 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404 53 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139 54 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605 55 Runner 0x000000010beddb6b main + 75 56 libdyld.dylib 0x00007fff51a231fd start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
FLUTTER RUN –VERBOSE(错误):
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3) #1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:336:7) <asynchronous suspension> #2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:703:11) <asynchronous suspension> #3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:620:33) <asynchronous suspension> #4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart) #5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29) #6 _rootRun (dart:async/zone.dart:1184:13) #7 _CustomZone.run (dart:async/zone.dart:1077:19) #8 _runZoned (dart:async/zone.dart:1619:10) #9 runZoned (dart:async/zone.dart:1539:10) #10 AppContext.run (package:flutter_tools/src/base/context.dart:149:18) #11 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:610:20) #12 CommandRunner.runCommand (package:args/command_runner.dart:197:27) #13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:21) <asynchronous suspension> #14 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart) #15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29) #16 _rootRun (dart:async/zone.dart:1184:13) #17 _CustomZone.run (dart:async/zone.dart:1077:19) #18 _runZoned (dart:async/zone.dart:1619:10) #19 runZoned (dart:async/zone.dart:1539:10) #20 AppContext.run (package:flutter_tools/src/base/context.dart:149:18) #21 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:288:19) #22 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25) #23 new Future.sync (dart:async/future.dart:224:31) #24 CommandRunner.run (package:args/command_runner.dart:112:14) #25 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:231:18) #26 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22) #27 _rootRun (dart:async/zone.dart:1184:13) #28 _CustomZone.run (dart:async/zone.dart:1077:19) #29 _runZoned (dart:async/zone.dart:1619:10) #30 runZonedGuarded (dart:async/zone.dart:1608:12) #31 runZoned (dart:async/zone.dart:1536:12) #32 run.<anonymous closure> (package:flutter_tools/runner.dart:61:18) <asynchronous suspension> #33 run.<anonymous closure> (package:flutter_tools/runner.dart) #34 runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart:64:18) <asynchronous suspension> #35 runInContext.runnerWrapper (package:flutter_tools/src/context_runner.dart) #36 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29) #37 _rootRun (dart:async/zone.dart:1184:13) #38 _CustomZone.run (dart:async/zone.dart:1077:19) #39 _runZoned (dart:async/zone.dart:1619:10) #40 runZoned (dart:async/zone.dart:1539:10) #41 AppContext.run (package:flutter_tools/src/base/context.dart:149:18) #42 runInContext (package:flutter_tools/src/context_runner.dart:67:24) #43 run (package:flutter_tools/runner.dart:48:10) #44 main (package:flutter_tools/executable.dart:69:9) #45 main (file:///b/s/w/ir/k/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3) #46 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32) #47 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
解决
该问题已解决,X代码日志显示LaunchScreen错误,更改了LaunchScreen故事板并加载了应用程序。