Search code examples
iosflutterxcodeios-simulatorsimulator

Flutter application didn't launch in my simulator


I want to launch my flutter application on simulator and I have some problem with it. I have no problems with building the project, but it create an app icon on simulator and launch for one second, then it turns off and nothing happens.

PS: I have two Xcode versions 14 and 14.3 installed, the problem with the project build appeared after updating Xcode to version 14.3

It's my terminal log: Launching lib/main.dart on iPhone 14 Pro Max in debug mode... Running pod install... 1,758ms Running Xcode build...
Xcode build done. 46.8s

Heare my fvm flutter doctor -v log: fvm flutter doctor -v
[!] Flutter (Channel stable, 3.7.7, on macOS 13.3 22E252 darwin-arm64, locale en-UA) • Flutter version 3.7.7 on channel stable at /Users//fvm/versions/3.7.7 ! Warning: dart on your path resolves to /opt/homebrew/Cellar/dart/2.18.0/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users//fvm/versions/3.7.7. Consider adding /Users//fvm/versions/3.7.7/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2ad6cd72c0 (4 weeks ago), 2023-03-08 09:41:59 -0800 • Engine revision 1837b5be5f • Dart version 2.19.4 • DevTools version 2.20.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users//Library/Android/sdk • Platform android-33, build-tools 33.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0) • Xcode at /Applications/Xcode copy.app/Contents/Developer • Build 14A309 • CocoaPods version 1.12.0

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1) • 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.15+0-b2043.56-8887301)

[✓] VS Code (version 1.77.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.62.0

[✓] Connected device (3 available) • iPhone 14 Pro Max (mobile) • 237C4493-9B18-4B40-8495-FA2B6C181137 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.3 22E252 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 111.0.5563.146

[✓] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 1 category.


Solution

  • After some time I found the following error: Exception NSException * "FirebaseApp.configure() could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/." 0x00006000005811a0

    Here's how I solved it: Here are the steps to add the GoogleService-Info.plist file to your Xcode project:

    • Go to the Firebase Console at https://console.firebase.google.com/
    • Select your project and click on the gear icon in the top left corner to go to Project settings.
    • In the Project settings page, scroll down to the "Your apps" section and click on the iOS app you want to configure.
    • In the "App settings" section, scroll down to the "GoogleService-Info.plist" section and click on the "Download GoogleService-Info.plist" button.
    • Save the downloaded file to your local computer.
    • Open your Xcode project and drag the downloaded GoogleService-Info.plist file into your Xcode project. Make sure to select the option to copy the file if needed.
    • In Xcode, select your project in the project navigator, and then select your target. In the "General" tab, scroll down to the "Frameworks, Libraries, and Embedded Content" section.
    • Make sure that the GoogleService-Info.plist file is listed under the "Copy Bundle Resources" section. If it's not, click the "+" button and add it.