react-native xcode 10.1 "config.h" file not found - ios

Recently, I upgraded from Xcode 9 to Xcode 10.1 for my existing react-native project. My RN project worked perfectly from Xcode 9, but after opening it in Xcode 10.1, I cant build my project in Xcode 10.1. It gives error saying
cant find "config.h".
I have also tried cleaning and restarting the xcode.

A somewhat obtuse quirk in 10.1 is that it switches legacy build settings to their new default. Go to your target's Workspace (or Project) Settings (File > Workspace Settings) and change Build System from New Build System back to Legacy Build System.

Related

Xcode error "the project cannot be opened because it is in a future Xcode project file format."

I have a macOS version 10.13.6, so the only version of Xcode I can download is 10.1.
Now when I create a new iOS project with Cordova and try opening it with Xcode, I get this error:
The project at 'project-location' cannot be opened because it is in a future Xcode project file format. Adjust the project format using a compatible version of Xcode to allow it to be opened by this version of Xcode.
How can I adjust the project to run on Xcode version 10.1 if I can't open it in Xcode in the first place?
According to the Cordova iOS Platform Guide, Cordova requires Xcode 11 or later so you can't use it with Xcode 10.1.

Apple Mach-O Linker Warning, in xcode 9.4

I update xcode version 9.4 to 10.2.1, I have created a project on xcode 9.4, run it once on xcode 10.2.1 and then delete this version and switch back to xcode 9.4 due to some reasons ... when I tried to run project on xcode 9.4 it gives lot of warnings and 198 errors
how to solve this issue.
If it's only linker errors, try to clear derived data on Xcode (Which you can access from Xcode > Preferences > Locations) and run application after clean and build. Some times your lesser disk spay might caused to these kind of issues as well.
When you opened the project on XCode 10.2.1 did you allow the project to be updated to the "recommended settings"?
It would have appeared as the yellow yield icon in the issues log.
A possible solution is to go into Time Machine (hopefully you keep backups) and revert your project folder to a copy from before you updated XCode

Simulator is not working with upgrading xcode 10?

After updating the Xcode 9.4.1 to Xcode 10, no one simulator is working to build the iOS application.
My iOS Application was building and running perfectly on Xcode 9.4.1
I have multiple warnings like this:
warning: The iOS Simulator deployment target is set to 7.0, but the
range of supported deployment target versions for this platform is 8.0
to 12.0.
ScreenShot for Xcode10 error :
And showing Multiple command produced in logs.
I have tried following approaches :
Delete derived data
Restart xcode
Create simulator manually from Xcode>Device/Simulator
Not one works for me. Please guide me.
The simple way is to come back to the legacy build system, it seems to be a problem of the new build system.
Open XCode, then click on File -> Project Settings.
Into the Shared Project Settings choose Legacy build system to the build system.
in xcode 10 : File -> workspaceSetting -> build System

Module compiled with Swift 4.0 cannot be imported in Swift 4.0.1

However I have recompiled the framework using the same Xcode and it still gives me this error.
Base SDK iOS 11.1 for both
Swift Language Version Swift 4.0 for both
Not using Pods/Carthage
I hope someone might know
Update:
For release versions of Xcode:
This error (and similar errors involving Swift 4.1, 4.2, etc.) will occur when opening a project with Xcode 9.1, 9.2, 9.3, 9.4, 10, etc. that uses frameworks that were built with earlier Xcode tools.
To fix the issue, update and rebuild your frameworks using Carthage ( carthage update --platform iOS), Cocoapods (pod update or pod install), or manually, with the new updated Xcode tools. The tools should be updated automatically when you update Xcode, but if not, you can follow the steps outlined below in the original answer.
You may also need to clean your project cmd + shift + k and possibly your build folder cmd + option + shift + k to get Xcode to not use cached framework builds.
In some cases you may also need to delete your derived data folder (Easily found by going to Xcode Preferences -> Locations -> Derived Data Folder
(Thanks Stunner)
For beta versions of Xcode:
See original answer below and then follow steps above.
Original Answer:
You probably still have your xcodebuild tools set to Xcode 9.0 which builds with Swift 4.0 and is incompatible with Xcode 9.1 beta's Swift 4.0.1.
Check in the terminal using the command:
xcodebuild -version
Or just go into Xcode preferences -> Locations and check/change the command line tools to Xcode 9.1. You should be set then.
My issue was due to an external framework not being compiled for Swift 4.0.2. I had added this file via Carthage, so running:
carthage update --platform iOS
And then cleaning the project cmd + shift + k and build folder cmd + option + shift + k and deleting the derived data folder (merely moving it to trash works as well) worked for me.
In my case, I downloaded xCode 11 Beta version to test SwiftUI. When i run my project, i got "Module compiled with Swift 5.1 cannot be imported by the Swift 5.0.1 compiler:..." error.
To do fix this issue. i changed xCode command line tool to new xCode 11 comment line tool. After that, you can create new xcode project with SwiftUI.
Xcode -> Preferences -> Location -> XCode command Line Tool
i hope, this will help someone who want to test with new freamework :)
Install Xcode Toolchain of specific Xcode version which was working for you from here.
An Xcode toolchain includes a copy of the compiler, lldb, and other related tools needed to provide a cohesive development experience for working in a specific version of Swift.
Open Xcode's Preferences, navigate to Components > Toolchains , and select the installed Swift toolchain.
This will let you compile and run the app for now.
I hit this issue with Xcode 10 beta, which adds Swift 4.2. My issue was unrelated to Carthage or any external dependencies.
Go to YourTarget > Build Settings > Swift Language Version for all of your Xcode targets.
Mine were all set to Swift 4.
After adding a Copy Files Build Phase, I started getting the error
:0: error: module compiled with Swift 4.1.2 cannot be imported by the Swift 4.2 compiler: /Users/user/Library/Developer/Xcode/DerivedData/MyApp-faskfrihumfcdibjxisjvbfshppp/Build/Intermediates.noindex/MyApp.build/Debug/MyAppExtension.build/Objects-normal/x86_64/MyClass~partial.swiftmodule
Command MergeSwiftModule failed with a nonzero exit code
I then set each target's Swift Language Version to Swift 4.2, which eliminated the error.
I'm not sure why the error was occuring in the first place, though, as having all targets set to Swift 4 should be equally as valid.
In my case (Xcode 9.2):
I went to Xcode Preferences > Locations > Derived Data
I then deleted the data and did a clean build and was ok.
In my case, I used CocoaPods with plugin cocoapods-binary to prebuild libraries to binaries. After I upgrade Xcode from 10 to 11, Xcode gives me this error:
Module compiled with Swift 5.0.1 cannot be imported by the Swift 5.1 compiler
I fix it by removing the /Pods directory and running pod install.
In my case, I re-compiled the framework with whatever version it was complaining about.
To recompile, run pod update or update the carthage (which ever one you're using), and build the project.
Then search for the framework in finder. Copy-paste the theFramework.framework to your project and make sure to "Copy items if needed."Build the project again and it should work.

Xcode9-beta2 destroyed my project/compiler/environment

My project works fine in Xcode 8.3.3. When I compile my project with Xcode 9, it shows compile error in some C++ files which have been included into my project for a long time. Then I switch to Xcode 8.3.3 and just want it built successfully, however, Xcode keeps on showing the previous error in Xcode 9.
Clean project/delete derived data/relaunch Xcode/reboot/uninstall Xcode9 and reinstall Xcode 8.3.3, all of them don't work. I think some of configurations are destroyed by Xcode9-beta2.
Anyone could help.

Resources