Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter build IOS on root of my flutter app does not work

Tags:

Whenever I run this command from terminal: flutter build ios in the root of the project for my flutter app, I get back:

Cannot find "xcodebuild". Xcode 9.0 or greater is required to develop for iOS.

Encountered error while building for device. I have the lastest Xcode (Version 10.0).

Flutter doctor:

[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-GB)     • Flutter version 0.8.2 at /Users/h/flutter     • Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700     • Engine revision 58a1894a1c     • Dart version 2.1.0-dev.3.1.flutter-760a9690c2  [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)     • Android SDK at /Users/h/Library/Android/sdk     • Android NDK location not configured (optional; useful for native profiling support)     • Platform android-27, build-tools 27.0.3     • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java     • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)     • All Android licenses accepted.  [!] iOS toolchain - develop for iOS devices     ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.       Download at: https://developer.apple.com/xcode/download/       Or install Xcode via the App Store.       Once installed, run:         sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer     • ios-deploy 1.9.2     • CocoaPods version 1.5.3  [✓] Android Studio (version 3.1)     • Android Studio at /Applications/Android Studio.app/Contents     • Flutter plugin version 24.2.1     • Dart plugin version 173.4700     • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)  [✓] Connected devices (1 available)     • h iPhone • 77afb908fc6c490d3fca62cdde9a74ab4e45b4f0 • ios • iOS 11.4.1  ! Doctor found issues in 1 category. 

I assume the IOS issue is thrown as I am running Xcode from an external HD

like image 329
heyr Avatar asked Sep 23 '18 20:09

heyr


People also ask

How do I run iOS app in launch mode Flutter?

To compile in release mode, we just need to add the --release flag to the flutter run command and have a physical device connected.

Do I need to install Xcode for Flutter?

If you only want to develop for Android, you can skip Xcode. Visual Studio Code is optional. Depending on whether you want to develop for Android or iOS (or both), you still need to install Android Studio and / or Xcode.

Does Flutter support both iOS and Android?

What kinds of apps can I build with Flutter? Flutter is designed to support mobile apps that run on both Android and iOS, as well as interactive apps that you want to run on your web pages or on the desktop. Apps that need to deliver highly branded designs are particularly well suited for Flutter.


1 Answers

The source of my problem was that Flutter could not find the latest installed version of Xcode.

To fix it, go to Xcode->preferences->locations->set value for command Line tools.

like image 130
Julian Re Avatar answered Sep 20 '22 17:09

Julian Re