Search code examples
iosflutterdart

Flutter iOS build is stuck on "Running Xcode Build"


I recently got a mac to be able to test the iOS applications I made with Flutter/Dart. But when trying to transfer all my files to a Mac and try to test it, it gets on "Running Xcode Build."

I am importing 2 things in my pubspec.yaml file:

dependicies:
  flutter:
    sdk:
      cupertino_icons: ^0.1.2
      firebase_admob: ^0.9.0+10

In my podfile, which I was told to download on the google admobs documentation I have

pod 'Google-Mobile_Ads_SDK"

My Flutter Doctors reads:

[flutter] flutter doctor -v
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-US)
    • Flutter version 1.12.13+hotfix.5 at /Users/priscilla/Desktop/Temp/flutter
    • Framework revision 27321ebbad (5 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/priscilla/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /usr/bin/java
    ✗ Could not determine java version

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • 754DF0BD-203E-4A0A-B785-E92D4B1D9C38 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

! Doctor found issues in 2 categories.

And the change to my info.plist is: (The actual app ID is in my code, just didn't want to post it here)

<key>GADApplicationIdentifier</key>
<string>[APP_ID]</string>

If I were to create a new Flutter project from scratch, the given code runs perfectly fine. It is just when I try to import the files the project on my windows PC to my Mac.

I think a solution would be to create a new Flutter project and while creating import my files, but I am not sure how to do that. So at the moment, I created a new Flutter project, deleted all the files that comes loaded initially, then replaced them with my project files.


Solution

  • I had removed the external devices specifically external monitors attached to Mac. Then made the build.

    My build time came from 10min on average to 0.5 to 2 min max.