Strange compiler warning when precompiling prefix.pch - iphone

When I want to start my app, I get this:
clang: error: invalid version number in '-mios-simulator-version-min= '
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
What's going on? When I google this error, I'm getting ZERO. This seems to be a very strange failure.
Please apologize, that I can't give more information. It's because I'm completely clueless.
Help!

OK, I've found the solution:
.xcodeproj > General > Deployment Target ----> was empty!
This is not allowed.

Try cleaning your project and/or quitting and relaunching Xcode. I've had various odd problems with Xcode that require one or the other of those things.

In my case there is a space after 8.0 like "8.0 ". When I remove space and re-build error disappears.

Related

Xcode 10 Error: linker command failed with exit code 1

I just updated my Xcode to Xcode 10 and now my project will not run and I get the error:
ld: library not found for -lstdc++.6
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I do not know what this means and how to fix it. I tried googling everywhere for the answer and came up with nothing. How can I fix this?
Open the projectname.xcworkspace if you are using cocoapods not the projectname.xcodeproj.
Alternatively, using terminal
$ open projectname.xcworkspace
Hope this helps.
I had this problem today in C++ using a newly upgraded Xcode 10 in a project that does not use pods, unlike the other answers.
When I clicked on the linker error there were no details given. This stumped me for a while and then I realised you can right-click the linker error and click "reveal in log".
In my case it was just a function that I had renamed-but-not-updated-all-the-references-to-it causing a linker error, but the real problem was that the linker error details were not being shown when the error occurred.
go to your project directory in the terminal
Type:
pod deintegrate
pod install
In your project, open the Project Navigator, and expand the Frameworks folder. You will see the file -lstdc++.6 highlighted in red, delete it, rebuild your project and you're good to go.
You can open the RN..xcworkspace, and expand the Frameworks folder. You will see the file highlighted in red, delete it,
Learn the build and rebuild the project,
This problem will be resolved. goog cluck!
please use cocoapods for dependency management, if you already using it then remove all pods and add it again / update all pods
https://stackoverflow.com/a/52050043/9978212

Xcode 8.2, Swift Compiler Error: error: unexpected input file

After updating from Xcode 8.1 to 8.2, I am facing a Swift Compiler Error in my project. I am using the latest Swift version and Carthage for dependency management. It worked perfectly fine with Xcode 8.1, and now I have tried for hours to fix it by cleaning DerivedData and Simulator data, cleaning in Xcode and deleting the Build folder but nothing seems to help. I only have one Xcode version installed.
I get the following compile error:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd <ProjectSource>
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
-- all files to compile --
unknown>:0: error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code
The folder that it is referring to looks like this:
It is actually there so I have no clue about what is going on...
Help is much appreciated! :)
I had the same kind of issue and the comments helped me figure out my problem.
Indeed, this error occurs when there is a typo or an error with the "Other Swift Flag" option. In my case, this option was passed empty by my CI engine causing an error to the generated command line leading to the error :
"error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk"
As suggested in the comment, remove all Other Swift Tag except "$(inherited)" and check it works back as expected
Answering the question instead of commenting may help people straight forward :)
In my case it was simply because I had a file called .Swift (mind the capital S!). I renamed it correctly to .swift and all went fine.

xCode iOS Dev - Apple Mach-O Linker Error // Dsymutil Error

I'm in SERIOUS need of help. I have had 3 unsuccessful evenings of unproductive coding. Please someone, figure this error out & make me feel stupid for overlooking something so simple. :)
[ISSUE #1]
I keep getting the "Apple Mach-O Linker Error"
Linker command failed with exit code 1 (use -v to see invocation)
[ISSUE #2]
Also... I keep getting the "Dsymutil Error"
error: unable to open executable '/Users/PsychodelicFuzz/Library/Developer/Xcode/DerivedData/CHH-bmbqxvfwddzaupfaavvipxaqwvfx/Build/Products/Debug-iphonesimulator/CHH.app/CHH'
Thanks to anyone willing to lend a helping hand <3
Change Debug Information Format from build setting to "DWARF"
These are likely related. dsymutil is getting an error because your executable binary CHH.app doesn't exist. It doesn't exist because ld failed.
Open the Log Navigator pane in Xcode, click on your build entry in that pane after the build has failed, then if you hover over the right-hand side of the line for "Link ... CHH.app" you'll see a disclosure icon - hit that and you will see the actual ld invocation and the actual error message that it printed. With luck that will get you pointed in the right direction.

GCC-4.2 Failed With Error Code 1

I am receiving the following error out of the blue after trying to build my iPhone Application onto my iPod Touch:
Command /Xcode3/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
I am also receiving the following warnings which I presume have something to do with this error, maybe a possible cause:
ld: warning: in /Users/Max/git/iTopCharts/iTopCharts/Classes/NSAdditions/libNSAdditions_Device.a, missing required architecture i386 in file
ld: warning: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file
All help with this is extremely appreciated, as I have spent days making this application.
This error is caused by many different problems.
Sometimes it gets called, when some file has been deleted, but its reference is still in the Xcode.
OR
It might occurs, if you have copy-pasted data from some other project. In some cases, Xcode keeps the reference with it. (If this is the case, then you need to trace that variable, and rename it)
If none of above meets your case, then you need to look at the error in more details. For this,
In xcode, right click the error line and choose "Open These Latest Results as Transcript Text File". This will open the real xcode output log, which should contain a better description of the error then was previously seen.
EDIT:Be sure to search 'exit code 1' and the description will be right above the results.
I hope it helps

Xcode Error When Building

Whenever I compile something in Xcode, I get 3 errors. One is under "Checking dependencies" and says "Unable to create directory /var/folders/zZ/string of letters/more directories/more letters." What is wrong with Xcode/my computer? I switched to the Xcode 4 preview and that works fine, but is not stable. Yes, I have tried restarting. This has been going on for weeks. Thanks for the help.
I had a similar issue, which showed up after switching to xcode 4. The error was:
error: unable to create '/build' (Permission denied)
The solution was to change '/build' to 'build' in the project configuration under Intermediate Build File Path.
In your case I would guess the pch file has a path that starts with '/'.