问题
你好,我有困难,而在iPhone模拟器上运行我的Flutter应用程序。它停留在“Xcode构建完成”。顺便说一句,它运行在Android模拟器上非常好。
这是我第一次在这里提问,所以如果需要更多的信息,或者有什么不合适的地方,请告诉我。任何形式的帮助(或评论)都将不胜感激。谢谢。
尝试手动启动应用的视频:https://user-images.githubusercontent.com/60031762/141050073-648a9893-0e33-425e-9c9d-24966bf1be39.mov
另外,我还在Flutter Github上开了一期:https://github.com/flutter/flutter/issues/93361
以下是详细信息:重现步骤和日志。
重现的步骤
操作系统:macOS Big Sur 11.6,连接到我的iPhone 11 pro(iOS 15.1)的USB网络(热点)。
1.克隆https://github.com/kws1207/friendship/tree/main/where_to_eat并打开项目。
1.运行模拟器,打开iPhone 12 Pro Max,iOS 14.4。
1.请执行flutter run
。
1.选择在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=sharingflutter 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
型
的数据
5条答案
按热度按时间drnojrws1#
请检查list_screen中的错误,第548行和第690行。删除Podfile.lock。运行flutter clean。然后运行
flutter run
。从项目的根目录使用cd ios
导航到终端中的ios文件夹。运行pod install
。现在,一旦安装了pod,在xcode中打开xcworkspace文件,您可能会看到一个警告,要求您升级最低版本的ios。允许它升级设置。现在从xcode中选择模拟器并点击播放。一旦它从xcode中播放良好,您应该也可以直接从Android Studio中运行它。ukxgm1gy2#
你需要将firebase配置初始化到appdelegate.swift文件中。
字符串
hs1ihplo3#
请尝试在Xcode中的buildSettings中添加新用户定义的iOS应用程序
键
EXTRA_FRONT_END_OPTIONS
,值为--no-sound-null-safety
并清除派生数据,重新构建它,然后运行它。
zbq4xfa04#
问题是我删除了“复制捆绑资源”中的所有组件。我在上面添加了Main.storyboard,应用程序运行良好。
的数据
vpfxa7rd5#
我简单地关闭了Xcode并尝试了flutter run。