What to do if the build fails with the error "Module compiled with Swift x.x.x cannot be imported by the Swift x.x.x compiler"

Purpose / background

Participated in an iOS application development project for the first time. I got an error when I tried to load an existing iOS project and build it, so I write it as a memorandum.

What happened

I got an error when I tried to load an existing iOS project with Xcode and build it.

Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.1 compiler: /Users/xxxxxxx/Desktop/project/Carthage/Build/iOS/Tabman.framework/Modules/Tabman.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

Cause

  1. Carthage, a library management tool, was not installed on your Mac
  2. You did not select the Xcode to use for Command Line Tools
  3. The carthage library included in the source could not be updated

Conclusion

1. Install Carthage

$ brew install carthage

2. Specify any Xcode with Command Line Tools

Open Xcode and open [Xcode> Preferences> Locations] from the menu. Select any Xcode from the Command Line Tools pull-down.

3. Carthage library update

$cd project root path
$ carthage update --platform iOS

Recommended Posts

What to do if the build fails with the error "Module compiled with Swift x.x.x cannot be imported by the Swift x.x.x compiler"
What to do if the adb command cannot be executed
What to do if JavaMail cannot be used with OpenJDK 11 or later
What to do if SPA URL loading cannot be detected by WebView shouldOverrideUrlLoading
What to do if the debug gem installation fails
What to do when build fails by rbenv install / pyenv install with anyenv (Debian system)
What to do if you cannot execute with the command "Java package name / class name"
[Rails] What to do if you can't get an error message with the errors method
What to do if validation doesn't work with the update action
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
Notes on what to do if Ubuntu 20.04 installation on Virtual box 6.1 (Windows10) fails with "Error 5 Input / output error"
What to do about the "cannot be read or is not a valid ZIP file" error
What to do when CentOS cannot be started with VirtualBox on Catalina
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you don't like the code generated by swagger-codegen-cli
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you can't activate the select box created by bootstrap-select
What to do if you get the error message unrecognized selector send to instance "***"
[Swift] What to do if the app icon is set but not reflected
What to do if build from command line fails in Android development environment
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
What to do if the server tomcat dies
What to do if mvn archetype: generate fails
[React.useRef] What to do when the latest state cannot be referenced in the event listener
What to do if you get the error Couldn't find Item without an ID
What to do if the JSONHint annotation does not work with lombok and JSONIC
What to do if the Rails server can't start
What to do if rails server can't be stopped
What to do if an ActionController :: UnknownFormat error occurs
What to do if password authentication fails in Docker/Postgres
[Rails] What to do when rails db: migrate cannot be done because there is no table referenced by the foreign key
[JMH] What to do if the JMH Gradle Plugin says FAILURE: Build failed with an exception. A failure occurred while executing me.champeau.gradle.IsolatedRunner [Gradle]
[Java] [Spring] What to do if you cannot Autowire with Type Mismatch after annotating Spring Security
What to do if you don't see the test code error message in the terminal console
What to do if you change the Listen Address from the settings screen with Mattermost docker
What to do if you installed Ruby with rbenv but the version does not change
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do if mysql2 gets a bundle install error
What to do if you can't use the rails command
[Ruby] What to do when the error "cannot load such file" appears when executing VS Code debug
What to do if an SSH key authentication error occurs during automatic deployment to EC2 with Capistrano
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if the app is not created with the latest Rails version installed when rails new
What to do if an error occurs in VS Code when importing a django module or your own module installed by pip install
[Ubuntu 20.04] What to do if the external monitor is not recognized
What to do if you get a gcc error in Docker
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
What to do if the Eclipse Maven dependency Jar is wrong
What to do if you get a DISPLAY error in gym.render ()
What to do if you get angry with OpenSSL with pyenv install
What to do if you forget the root password in CentOS7
[Rails] What to do if you can't get parameters with form_with
What to do if you should have installed Rails but an error occurs with rails -v (for beginners)
[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
[Gradle] [checkstyle] What to do if the active setting of Checkstyle is removed by "Refresh Gradle project" from Eclipse
What to do when the error "Non-static variable x cannot be referenced from static context" in Java. Lessons from the very first step in programming Remarks 01