XCode - Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1 - ios

Lately I've started to take up a course for learning swift to devolp iOS OS X and Watch OS apps. I'm taking this course on udacity. The first step is to download a project and put it in a folder on your desktop. I had to open the app and then run it, which should've worked. But not for me somehow. I hit run and the following error showed up (this is the complete error log):
Some poeple suggested that I should update my XCode but I already have. I currently have XCode 7.3! I'm quite new to this platform, that's also why I'm doing this course, so I don't really know what I have to do. Can someone please tell me what's going on here?

This is the result of a corrupted swift class. If you encounter a class looking similar to the following code:
Ôæ≠fiÔæ≠fiqcaJÔæ≠fihJ0ç硡ˇ2ç硡ˇ$5y$ġˇˇ% 7.ġˇˇÔæ≠fiÔæ≠fiP‚—ġˇˇfl‚ġˇˇ ˗ġˇˇ∞B‚ġˇˇÄ+€
Try to re-create the class or re-download it. This solved my problem and to me, it would look like the only solution possible for a corrupted class.

Delete derived data.
Windows->Projects->select your project and delete derived data
This worked for me for couple of projects which i downloaded from internet.

I do everything restarts Xcode, rebuild Project, adding toolChains lock unlock them,
so there are two possibilities
first, maybe you install the beta version of Xcode
or try this, this work for me->
I tried to run a project in Xcode12/Swift4, while the project was written on Xcode8/Swift3
so I install Xcode version 11.7 and run this work for me.
if you not done with 11.7 then install another version of Xcode and try the appreciated version
May this help you

Related

Xcode 8.3 Indexing & Building Extremely Slow

I am posting this after reading many similar posts on here regarding this issue and none of the solutions that worked for other people not working...
Xcode Version 8.3.3 (8E3004b)
Swift 3.1
Things I tried
Deleting Derived Data folder
Deleting Workspace File
Cleaning Build Folder
Cleaning Build
Reinstalled Xcode (after complete removal)
I also looked for Swift Issues:
Removed all concatenating strings
Cleaned up Swift arrays and dictionaries
Added Whole module optimizations
This all started happening after last Xcode update of 8.3.3. My project was compiling within seconds and now I have to wait at least 15 mins for it to index, then 5 minutes to compile after everything I change even something small in code.
When Building, it get stuck in "Compiling Swift source files". Is there way for me to look in to where it is actually getting stuck?
BIG UPDATE
I tried pretty much everything. Read every article, post, ect. NOTHING worked. My project was created right after 10.0.
Solution
Creating a new project and copying each file worked! It used to take 8-9 minuted to build. Now less than 2 seconds!
Apple knows about this problem, and says that Xcode 9 beta will perform much better. Note that if you don't want to update to Swift 4, you can continue compiling in Swift 3 mode using Xcode 9. The big limitation is that you won't be able to submit your project to the App Store until Xcode 9 goes final.
Also, Xcode 9 contains a new build system. You don't get it by default: you have to turn it on for this project. Choose File > Project Settings and switch the pop-up menu to New Build System (Preview). This is experimental, but it will be the default build system eventually, so it would be interesting to know whether this makes an appreciable difference.
If you don't want to update to Xcode 9 beta, you will just have to do a binary search: comment out all your code and start adding it back, piece by piece, until you find that piece that's causing the trouble.
The best way to work this out is to find what out what the build is doing while compiling your code. This is a really useful tool to use: https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode
When you run this tool it will show you what methods are taking the longest to compile, and then you fix those. Once you have done that, you can also try the answer I gave here to decrease the build times: Extremely long compilation times with Swift in Xcode

Apple Mach-O Linker Warning after xCode Update [duplicate]

I have a slight issue when build my Xcode project, get tones of warning after update pod. It looks like this
Already search the whole site here but still no luck. it doesn't affect the project but it is quite annoying. Anyone could help?
It probably means their binary file has non-aligned pointer when they compile their code. In those cases the alignment basically defaults to 1 byte and hypothetically might impact performance.
After updating to Xcode 8.3 public release I am still seeing this error, so Google might need to compile their static library with different settings to make it go away.
Got this response from firebase support:
This is a known issue with Xcode 8.3 beta, so it might be a beta thing
and Xcode being extra verbose. It works well though with 8.2.1 so I
recommend temporarily use it to avoid the warnings or ignore the
warnings on 8.3 beta if it does not affect your app.
This has been fixed in Firebase 3.16.0 (Firebase Core 3.6 + Firebase Analytics 3.8.0)
guys, it is all fixed now. Tested it all myself on two projects. You got to go to the correct directory of your project so that your pod spec file is visible to your command line commands, run
pod update
and see it all fixed and working properly!
These problems are addressed, and likely fixed, with release 3.16.0.

Reference to xml_****_**** is ambiguous

I have updated my Xcode to the latest version of 8.0
After the update, I am facing a new build error preventing me to run the project on the simulator.
The error is the below in DDXMLNode.m:
reference to 'XML_DOCUMENT_NODE' is ambiguous
I am using the XMPP framework as pods (pod 'XMPPFramework') so I still can't figure out a way to solve this.
Note that the project is working normally on the device and was working on both Device and Simulator with the previous Xcode Version.
I have tried to search the internet but I still didn't find any solution for this.
I tried to clean the project and delete everything in the DerivedData folder as well, but it didn't solve the issue.
Appreciate any help.
Actually I am posting this answer in case it may help someone in the future.
After searching a lot without finding any answer, I discovered the following:
There is a file called module.modulemap that contains 2 methods.
module libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
module libxmlSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
The first one is used for real devices, the other one for the simulator.
However, when building the app on the simulator, and for a reason that I didnt figure it out, tree.h is being duplicated and causing all these issue.
So what I made to be able to run the project on the simulator was to comment the first method so the app can build successfully.
NB: Don't forget to uncomment the method once you want to run the project again on the real device.
Hope this will help anyone who will face the same issue.
i have tried some way.
I search the word XML_DOCUMENT_NODE with a result here:
then replace every error with the left symbol. It turns out to be OK for me now.

Error when trying to run application after previously i deleted derived data Xcode 7.2

Hey I keep getting this error. I think its because earlier i deleted everything in derived data folder and now i get this error when i try to run my project this is a new little test project I'm doing for the apple watch does anybody know how to fix it? Thanks
I recognize this issue and I tried to restart Xcode, my computer, clear cache, clean etc when I also had this problem, without any luck. The only thing that got it working for me was to completely uninstall Xcode and remove all files. Check this post of how to do that.

XCode 6.2 UIKit.h Foundation.h not found

I have recently updated version to xCode6.2 and previous one I was using xCode6.2 beta.
It works fine with all previous versions and xCode6.2 beta as well.
When I am update it's version, I have removed xCode beta completely and install new one. But it is getting this issue, and I have added UIKit, Foundation to libraries. No luck yet.
The thing what I have tried and suspicious additionally;
Check framework search path at build settings(nothing mentioning that)
Other LD Flags in build settings.
This is suspicious, because it's have keys -frameworks Foundation, -frameworks UIKit
Have not enough understandings about other LD flags this values, so tried to remove them, but nothing new.
When I open other project with new version of xCode, they are all working fine but just that project.
Can anybody help this?
It's probably better to simply uninstall xcode completely with appCleaner or such. And reinstall it.
I suspect it will work and you will save time otherwise spent searching for a solution.
After struggling a few hrs, I found the solution.
The error was because of the some path specified in OTHER_LD_FLAGS and OTHER_C_FLAGS have not changed.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk
It was like this but it should be iPhoneOS8.2.sdk according to the changes of xCode version

Resources