question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failed on iOS (SWIFT_VERSION)

See original GitHub issue

Hi,

the example works fine. But when I tried to compile my own project, the following error occurred:

	Error output from Xcode build:
	↳
	    ** BUILD FAILED **
	    
	Xcode's output:
	↳
	    === BUILD TARGET contacts_service OF PROJECT Pods WITH CONFIGURATION Debug ===
	    The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
Could not build the precompiled application for the device.

I figured out, that the solution/ workaround is to change the configuration in “ios/Runner.xcodeproj/project.pbxproj”: from VERSIONING_SYSTEM = "apple-generic"; to

SWIFT_SWIFT3_OBJC_INFERENCE=On;
SWIFT_VERSION=4.0;

Is there a dependency compiled in an earlier swift version that could be updated?

Best, Marcus

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

10reactions
mavimocommented, Jul 10, 2018

@blaneyneil seems a “non issue”, do you bootstrap the flutter project using swift? Since this plugin use swift you need to use -i flutter flag when do you create a project. No solution to add swift support on already running project, the suggested solution is to:

  • create a new project with the same name in a different folder including swift support
  • backup your ios folder
  • replace current ios folder with the ios folder created from new project that include swift support

I tested it and work like a charm (see other issue), eg (supposing your project is awesome_project):

$ ls .
awesome_project
$ mkdir test
$ cd test
$ flutter create -i swift awesome_project
$ cd ..
$ mv awesome_project/ios awesome_project/ios_bak
$ mv test/awesome_project/ios awesome_project/ios
$ rm -rf test
$ cd awesome_project
$ flutter packages get

than edit the ios/Runner/Info.plist to include permission and rebuild your flutter project.

1reaction
idurveshcommented, Aug 28, 2019

Do what Mavimo suggested or you can simply remove ios folder and run this command $ flutter create -i swift .

This will rebuild the project with swift integration

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode build keeps failing due to Swift error - Apple Developer
I am trying to get my project to build but I keep getting compile errors in one of the files that is provided...
Read more >
Swift Ios Build error due to sdk versions
I am trying to build a simple ios project using swift compiler (compiled from source). I was once able to achieve this but...
Read more >
xcode - Swift Version Conflict: this SDK is not supported by the ...
I got this error for one of my local SDKs: Failed to build module 'CbSdk'; this SDK is not supported by the compiler...
Read more >
Oh dear! Build errors? - LoopDocs - GitHub Pages
Solution: Go to your Xcode -> Preferences (or Settings) and under the Locations tab, select your Xcode version (the figure shows 14.0.1 -...
Read more >
Xcode 13 betas: Build fails in Combine · Issue #3481 - GitHub
swift :25:5: Failed to build module 'Combine'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found