Question
Hello, I’m having difficulty while running my Flutter App on iPhone simulator. It stucks on ‘Xcode build done’.
BTW, It runs very well on Android emulator.
It’s my first time to ask a question here, so please let me know if more information is needed, or something seems inappropriate.
Any kind of help (or comment) would be appreciated. Thank you.
The video of trying to launch the app manually:
https://user-images.githubusercontent.com/60031762/141050073-648a9893-0e33-425e-9c9d-24966bf1be39.mov
p.s. I also opened an issue on flutter github: https://github.com/flutter/flutter/issues/93361
Below are details: steps to reproduce and logs.
Steps to Reproduce
OS: macOS Big Sur 11.6, connected to USB Network(Hotspot) of my iPhone 11 pro(iOS 15.1).
- Clone https://github.com/kws1207/friendship/tree/main/where_to_eat and open the project.
- Run Simulator, open iPhone 12 Pro Max, iOS 14.4.
- Execute
flutter run
. - Select the Simulator opened in 2.
Expected results:
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
Actual results:
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)
Logs
Result of flutter run --verbose
is too long to post here, uploaded at:
https://drive.google.com/file/d/1DbiusrV3sNm3X03QAlDau3ztpqCBCw4S/view?usp=sharing
Result of 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)
Result of 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.
- Tried build from Xcode.
Output from 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
4
Answers
The problem was that I erased all components in 'Copy Bundle Resources'. I added Main.storyboard on it, and the app runs fine.
Please check the errors in list_screen, line number 548 and 690. Delete Podfile.lock. Run flutter clean. Then run
flutter run
. navigate to ios folder in terminal withcd ios
from the root of your project. Runpod install
. Now once the pods are installed open the xcworkspace file in xcode and you might see a warning asking you to upgrade minimum version of ios. Allow it to upgrade settings. Now select the simulator from xcode and hit play. Once it plays well from xcode you should be able to run it directly from Android studio also.You need to initialize the firebase config into appdelegate.swift file.
Please try this for iOS app inside buildSettings in Xcode add new user defined
the key
EXTRA_FRONT_END_OPTIONS
with value--no-sound-null-safety
and clear Derived data and rebuild it again and then run it.