Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run hello-world Flutter app in Simulator: “Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. #13422

Closed
filiph opened this issue Dec 7, 2017 · 11 comments
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@filiph
Copy link
Contributor

filiph commented Dec 7, 2017

Steps to Reproduce

  1. Open IntelliJ IDEA
  2. Create new Flutter project
  3. Select to use Swift instead of Obj-C (and Kotlin instead of Java)
  4. Open iOS Simulator
  5. Run in debug mode

Logs

$ flutter run
Launching lib/main.dart on iPhone 5s in debug mode...
Running Xcode build...                                0.6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** CLEAN FAILED **


    The following build commands failed:
    	Check dependencies
    (1 failure)
    ** BUILD FAILED **


    The following build commands failed:
    	Check dependencies
    (1 failure)
Xcode's output:
↳
    Build settings from command line:
        ARCHS = x86_64
        BUILD_DIR = /Users/filiph/dev/scifi_ui/build/ios
        ONLY_ACTIVE_ARCH = YES
        SDKROOT = iphonesimulator10.3

    === CLEAN TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

    Check dependencies
    “Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

    Check dependencies
    “Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Could not build the application for the simulator.
Error launching application on iPhone 5s.

$ flutter analyze
Analyzing /Users/filiph/dev/scifi_ui...
No issues found!
Ran in 4.3s

Flutter Doctor

$ flutter doctor
[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale en-US, channel master)
    • Flutter at /Users/filiph/dev/flutter
    • Framework revision 0350c9ecff (85 minutes ago), 2017-12-07 09:32:23 -0800
    • Engine revision f888186e50
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-edge.e7b7b68ef6e7b1e5df379b628134764c489901dc

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.3)
    • Android SDK at /Users/filiph/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-25, build-tools 25.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_112-release-b06)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.3.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 8.3.3, Build version 8E3004b
    • ios-deploy 1.9.2
    • CocoaPods version 1.2.1

[-] Android Studio
    • Android Studio at /Applications/Android Studio - Canary.app/Contents
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Community Edition (version 2017.2.5)
    • Flutter plugin version 17.0
    • Dart plugin version 172.4155.35

[✓] Connected devices
    • iPhone 5s • 1174F021-6AD2-4B98-B4AF-4AFAD670B531 • ios • iOS 10.3 (simulator)

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.

@filiph
Copy link
Contributor Author

filiph commented Dec 7, 2017

Xcode Version 8.3.3 (8E3004b)

@jcan37
Copy link

jcan37 commented Jan 25, 2018

For anyone struggling to work around this, if you open up the Runner project in the ios folder in Xcode, under "Build Settings" you can set "Use Legacy Swift Language Version" to "Yes" and then you should be able to run the app. This link should help: https://stackoverflow.com/questions/41118912/use-legacy-swift-language-version-xcode-8-2

@madd86
Copy link

madd86 commented May 22, 2018

Anyone know how to fix it on Xcode 9.3.1?

@zoechi
Copy link
Contributor

zoechi commented May 25, 2018

@madd86 have you tried flutter create with

image

@passsy
Copy link
Contributor

passsy commented Jun 20, 2018

I can verify that running flutter create -i swift fixes the problem. Actually it should be the default

@zoechi
Copy link
Contributor

zoechi commented Jun 20, 2018

@passsy Swift introduces quite some application size penalty. I think this is why it isn't the default.

@zoechi zoechi added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 20, 2018
@zoechi
Copy link
Contributor

zoechi commented Jun 20, 2018

@tvolkert

@Tonigt
Copy link

Tonigt commented Jun 28, 2019

=== BUILD TARGET signalr_plugin OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/lihaoyutonight/.pub-cache/hosted/pub.flutter-io.cn/flutter_inappbrowser-1.2.1/ios/Classes/InAppBrowserFlutterPlugin.m:19:9: fatal error: 'flutter_inappbrowser/flutter_inappbrowser-Swift.h' file not found
#import <flutter_inappbrowser/flutter_inappbrowser-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@jmagman
Copy link
Member

jmagman commented Nov 19, 2019

This should be fixed. See summary in #16049 (comment). Let us know if there is more to track here and we'll re-open.

@jmagman jmagman closed this as completed Nov 19, 2019
@Asepdadan

This comment has been minimized.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

8 participants