【发布时间】:2021-12-22 18:03:12
【问题描述】:
问题
您好,我在 iPhone 模拟器上运行 Flutter 应用时遇到了困难。它停留在“Xcode build done”上。
顺便说一句,它在 Android 模拟器上运行得很好。
这是我第一次在这里提问,所以如果需要更多信息,或者有什么不合适的地方,请告诉我。 任何形式的帮助(或评论)将不胜感激。谢谢。
尝试手动启动应用的视频: https://user-images.githubusercontent.com/60031762/141050073-648a9893-0e33-425e-9c9d-24966bf1be39.mov
附言我还在flutter github上开了一个issue:https://github.com/flutter/flutter/issues/93361
以下是详细信息:重现和记录的步骤。
复制步骤
操作系统:macOS Big Sur 11.6,连接到我的 iPhone 11 pro (iOS 15.1) 的 USB 网络(热点)。
- 克隆 https://github.com/kws1207/friendship/tree/main/where_to_eat 并打开项目。
- 运行模拟器,打开 iPhone 12 Pro Max、iOS 14.4。
- 执行
flutter run。 - 选择2中打开的模拟器。
预期结果:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
└─Compiling, linking and signing... 8.3s
Xcode build done. 268.6s
Installing and launching...
Flutter run key commands.
r Hot reload. ????????????
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with unsound null safety
For more information see
https://dart.dev/null-safety/unsound-null-safety
实际结果:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running Xcode build...
└─Compiling, linking and signing... 8.3s
Xcode build done. 268.6s
(it stucks here)
日志
flutter run --verbose 的结果太长,无法在此处发布,已上传至:
https://drive.google.com/file/d/1DbiusrV3sNm3X03QAlDau3ztpqCBCw4S/view?usp=sharing
flutter analyze 的结果:
Analyzing where_to_eat...
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:6:10 • non_constant_identifier_names
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:7:10 • non_constant_identifier_names
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:10:10 • non_constant_identifier_names
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:15:13 • non_constant_identifier_names
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:16:12 • non_constant_identifier_names
info • Name non-constant identifiers using lowerCamelCase • lib/domain/classes.dart:18:12 • non_constant_identifier_names
info • Don't import implementation files from another package • lib/screens/list_screen.dart:4:8 • implementation_imports
info • The value of the field '_auth' isn't used • lib/screens/list_screen.dart:57:9 • unused_field
info • 'await' applied to 'void', which is not a 'Future' • lib/screens/list_screen.dart:84:5 • await_only_futures
info • 'await' applied to 'void', which is not a 'Future' • lib/screens/list_screen.dart:85:5 • await_only_futures
info • 'await' applied to 'void', which is not a 'Future' • lib/screens/list_screen.dart:507:9 • await_only_futures
info • This function has a return type of 'FutureOr<Response>', but doesn't end with a return statement • lib/screens/list_screen.dart:548:25 •
missing_return
info • This function has a return type of 'Widget', but doesn't end with a return statement • lib/screens/list_screen.dart:690:10 •
missing_return
info • This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final:
RouletteScreen.labels • lib/screens/roulette_screen.dart:10:7 • must_be_immutable
info • Unused import: 'package:http/http.dart' • lib/screens/select_screen.dart:2:8 • unused_import
info • Duplicate import • lib/screens/select_screen.dart:8:8 • duplicate_import
info • Don't import implementation files from another package • lib/screens/select_screen.dart:11:8 • implementation_imports
info • The value of the field '_firestore' isn't used • lib/screens/select_screen.dart:30:9 • unused_field
info • Don't explicitly initialize variables to null • lib/screens/select_screen.dart:34:11 • avoid_init_to_null
info • The declaration '_showSignOutFailDialog' isn't referenced • lib/screens/select_screen.dart:96:8 • unused_element
info • 'await' applied to 'void', which is not a 'Future' • lib/screens/select_screen.dart:180:11 • await_only_futures
warning • The parameter 'addressEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'addressType' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'apartment' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'bcode' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'bname' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'bnameEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'buildingCode' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'buildingName' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'jibunAddress' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'jibunAddressEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'postCode' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'query' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'roadAddress' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'roadAddressEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'roadname' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'roadnameCode' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'roadnameEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'sido' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'sidoEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'sigungu' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'sigunguCode' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'sigunguEng' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'userLanguageType' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
warning • The parameter 'userSelectedType' is required • lib/screens/select_screen.dart:182:23 • missing_required_param
info • 'await' applied to 'void', which is not a 'Future' • lib/screens/select_screen.dart:272:5 • await_only_futures
info • The value of the field '_firestore' isn't used • lib/screens/signin_screen.dart:27:9 • unused_field
info • The value of the field '_userEmail' isn't used • lib/screens/signin_screen.dart:29:10 • unused_field
info • The value of the field '_userPassword' isn't used • lib/screens/signin_screen.dart:29:22 • unused_field
info • The stack trace variable 's' isn't used and can be removed • lib/screens/signin_screen.dart:315:27 • unused_catch_stack
info • The value of the field '_firestore' isn't used • lib/screens/signup_screen.dart:22:9 • unused_field
info • The value of the field '_userEmail' isn't used • lib/screens/signup_screen.dart:23:10 • unused_field
info • The value of the field '_userPassword' isn't used • lib/screens/signup_screen.dart:23:22 • unused_field
53 issues found. (ran in 3.6s)
flutter doctor -v 的结果:
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-x64, locale ko-KR)
• Flutter version 2.5.3 at /Applications/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (4 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/kws/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.11.2
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/google-chrome-unsafe)
! /Applications/Google Chrome.app/Contents/MacOS/google-chrome-unsafe is not executable.
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] IntelliJ IDEA Community Edition (version 2019.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 43.0.2
• Dart plugin version 192.8052
[✓] VS Code (version 1.62.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.28.0
[✓] Connected device (2 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
• iPhone 12 Pro Max (mobile) • 0A68628E-A233-40C2-8B07-504F23A5FD81 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
! Error: Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window. (code -1)
! Doctor found issues in 1 category.
- 尝试从 Xcode 构建。
Xcode 的输出:
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle </Users/kws/Library/Developer/CoreSimulator/Devices/0A68628E-A233-40C2-8B07-504F23A5FD81/data/Containers/Bundle/Application/F06A8FF1-690C-4F28-BCCC-C045F422BA70/Runner.app> (loaded)'
terminating with uncaught exception of type NSException
CoreSimulator 732.18.6 - Device: iPhone 12 Pro Max (0A68628E-A233-40C2-8B07-504F23A5FD81) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone 12 Pro Max
【问题讨论】:
标签: ios xcode macos flutter ios-simulator