Can't get rid of Apple LLVM 5.0 Error - ios

It keeps saying:
fatal error: file '/Applications/Xcode5-DP5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/NSObject.h'
has been modified since the precompiled header
'/Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P/ObjectiveC.pcm' was built
note: after modifying system headers, please delete the module cache at '/Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P'
1 error generated.
I must have deleted the derived data at least five times by now, and I'm getting nowhere. Any ideas?

Open a terminal and type in :
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
Clean your project and build again. Worked for me.

Delete the folder, clean the app, restart Xcode if necessary.

as per xcode 5.
click on Xcode preferences
Goto locations tab
click on the derived data path which navigates to the folder called DerivedData
Delete the whole folder and restart xcode.
This works fine for me.
Happy coding :)

Have you tried reinstalling xcode? And have you cleaned using cmd+shift+k ?

The same thing was occuring to me. The warning was telling me:
After modifying system headers, please delete the module cache at
'/Users/yunus.mehel/Library/Developer/Xcode/DerivedData/ModuleCache/13XL2DHZVON89'
So, I have restarted xcode, deleted derived data from Organizer, deleted derived data from the derivedData folder; none of them worked. Then I have realized, the solution was already there; go to:
"DerivedData/ModuleCache/13XL6DH2BON89"
and delete that folder, not the "DerivedData/<your_project>". Make a clean build, it will work again.

Run this script to delete all relevant files in /Library/Developer/Xcode/DerivedData and /var/folders:
# run with
# ruby reallyCleanXcode.rb
derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache

This happen when compiling, when running the app or neither?
Have you tried this:
Build Settings - Build Locations - Precompiled Header Cache Path -- there's a folder... delete it.

I solved this by:
Quit restart Xcode + clean project + clean build folders + clean derived data + deleted the /var/folders/.../.../C/com.apple.DeveloperTools/5.0.2-5A3005/Xcode/SharedPrecompiledHeaders + unplugged my iPhone
Rebuild and works :)

I was having the same problem. I did SHFT+CMD+K and tried to run,again the error appeared. My error pointed to the NSJSONSerialization header file. So what I did is deleted the files in ModuleCache and the project seems working now. I had changed my code which used NSJSonSerialization thinking it to be wrong, and project started working with the code also :)
To delete the files -- Click on 'Go' in the Desktop and then 'Go to folder' then type the folder path (Eg : 'Library/.…./ModuleCache') and delete all the files.
Regards,
ASK

Please follow below steps to get rid from your problem.
"Library/Developer/Xcode/DerivedData/ModuleCache/"
Delete all Folders inside ModuleCache Folder.
Make a clean build, quit Xcode and run it again
sure ,it will work fine.
Good Luck !!!

my solution,
in terminal, run command:
rm -rf /Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P
then in xcode, clean
then restart xcode and build

In addition to all of the other "clean your build" answers, nothing was working for me until I emptied out the (highly undocumented!) /var/folders directory.
Apparently, this is a "miscellaneous caches" dir maintained by OS-X. I didn't even bother figuring out what were "the correct files"; I just cleaned out the entire directory.
...And now I can build again. Hooray! From terminal:
[sudo] rm -rf /var/folders/*
(Although I did it from Finder, via authentication.) (OS-X 10.9.latest)
Additional clue: I could build with XCode-6-beta, but got the goofy corrupt error in XCode-5.

I used Shift + CMD + K to try and clean the project, but it did not disappear.
All I had to do was go and check the names of <yourProjectName>-info.plist and <yourProjectName>-Prefix.pch.
Then Shift + CMD + K worked.
In my case the problem was Clang exiting with code 1.

I was facing the same issue. I first cleaned the project do this by hitting "shift + command + k" and just rebuilt the project and it worked for me. hit "command + B" to rebuilt your project

Related

missing required module 'SwiftShims' error generated by Xcode in project

I copied my project in a running state but the copied project doesn't work for me although the actual project is running fine. When I build my copied project it gives me the following error:
I have cleared the cache and the derived data but the build still fails.
Does anyone have an idea what might cause this issue? Thanks in advance.
If you are using CocoaPods, open yourProject.workspace instead of yourProject.xcodeproj.
If you're working with SPM, deleting the .build folder and re-running swift build solves the issue for me.
Did you try to remove the cache ?
rm -rf /Users/abdulrehman/Desktop/StudentMentor/DerivedData/ModuleCache/DLJPQMLQI1Q/
(I might have wrong copied your file path. So feel free to type it manually if there is nothing to remove at this path)
Goto your project folder
Delete the contents inside the DerivedDataXcode folder.
Clean the project
Run.
I had the same error, but the reason turned out to be having different iOS versions specified as Podfile's platform :ios and as my project's deployment target.
SwiftShims is a module defined in the standard library. It shouldn't be missing. I think it's because your DerivedData path changed, and now the compiler can't find its cache anymore.
I had the same issue...and after a lot of trial and error, the following worked for me..
Open your Xcode Workspace File -> Project_name(directory option on left) -> build settings -> Excluded Architectures -> Select 'Any iOS simulator SDK' and type arm64 in front of that ( for both build and release).
Repeat the same procedure for pods
Go to VS code and delete pod-lock and pod folder
open podfile and Paste the following code right above "target 'name-tvOS' do" in podfile.
post_install do |installer| flipper_post_install(installer) installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end end
(Note: some of the code body form above may already be there. In that case replace that part with this.)
Save it and run 'pod install' in your project's terminal.
go back to xcode and clear build (Cmd+Shift+K) and then build your project (Cmd+B)
Hopefully it will build without any issues.. Happy Coding!
You may get this error if you rename the project directory.
For your reference, I was using Flutter, so
flutter clean
It was solved with.
I have once encountered for a private local pod, which somehow Cocoapod set the lib product name as eg. "MyLib-6c4b1003" -- with a prefix in hex.
This random hex somehow changed, but the project Other Link Flags still using the old one. I did the search to find out the references to the old hex and deleted them, run pod install and the right name will be used.
I still cannot understand why there is this random hex in the prefix, but seems like Cocoapods setting up of the project could reference to the wrong one.
I had a similar issue when I wanted to remove Alamofire from Cocoapods.
then it needs to delete something:
target -- Build Settings -- Other Swift Flags
This junk of code worked for me.
It happened to me when I was running the release version and switched back to the Debug version with Product > Scheme > edit schemes.
Deleting derived data didn't help.
But simply doing Product > Clean Build Folder and restarting XCode fixed the issue.
In case you see this error in the preview canvas and the diagnostics "mtime changed":
'/var/folders/kv/t_w2wdds3m1_0lr02hcp3dgw0000gn/C/clang/ModuleCache/12TRQXIDQ8QQD/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
Delete all .pcm files in that folder and hit try again.
The folder on your machine will be different. Copy the location and run:
rm <paste path here>/*.pcm
You can delete your Derived Data from Terminal by this simple command:
rm -rf ~/Library/Developer/Xcode/DerivedData/*

Build operation failed without specifying any errors for React Native Xcode project

I have a React Native project that works fine most of the time(Android and iOS). But sometimes out of nowhere I receive this error when I am trying to build the Xcode project (Xcode or react-native run-ios):
Build operation failed without specifying any errors.
Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie)
processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.
How do I solve this? Push to a branch on git, fresh clone, npm install, and all is working fine for a period. And after that the problem will repeat. Making fresh clones of project each time is a pain and takes long time. Is there another way or something that I don't know?
Maybe a some files that are in .gitignore is causing the problems, and after a fresh clone that solves the problem. This is the .gitignore file for my iOS project:
# Created by .ignore support plugin (hsz.mobi)
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
I had this same issue and it was fixed by deleting the contents of node_modules and doing a npm install in the parent folder.
I was faced with this problem too. And I noticed that my folder name was too long. I changed the project folder's name with the short one and this error gone. Try to change the project folder name.
It was really a time killer issue. I rebased the complete code base to a collegue's mac where it worked fine. After sparing more than a couple of morning hours I could find a solution.
Solution - Simply shorten your Project folder name (in mac).
This is undoubtedly irritating that its suggested to have longer and meaningful variable names but the folder name has to be this concise.
I had a issue with XCode 9.1 and iOS 11...
I solved this issue moving up my folder to another path, I know it doesn't make sense and is dumb but it really work for me. My project was at /Users/Me/Documents/MyProjectDir and I changed to /Users/Me/Desktop/MyProjectDir
What helped me was removing the ios/build folder in my React Native project, followed by rebuilding the project.
I highly recommend to run the build on console, to see if it outputs any other relevant information.
react-native run-ios --scheme "app-debug" # Or any aproppriate target
Read more about building+archiving from CLI here or try with other OSS tooling like fastlane.
For me it found bugs twice, that both were unrelated with the building process itself:
1) One was fixed rolling back to node v8 (LTS) apparently. It was very obscure, but I suspect had to do with having little memory available (running flow + packager + xcode + spotify + chrome on 8GB RAM MBP)
2) The other one was related to having a space on the xcode output. "App Canary.app" could not be installed. I figured it out doing ls ios/build/Build/products.... This error only happened after upgrading xcode, and wasn't happening with the release target, that did not have any whitespaces.
The only take away here is to run build directly on the console to debug further. You might find out things that are completely unrelated, and probably can't be solved by just removing the build folder.
Hope it helps.
Trashing ios/Build resolved this issue for me
In my case simulator is not shutdown correctly.
So I opened simulator manually again then I got an error that simulator is not shutdown correctly.So I relaunched the simulator successfully and built xcode project again. Error is resolved

iOS Swift No Such File or Directory In Debug-iphoneos

Somebody please save me.
This is the error I'm getting. I've tried cleaning, doing a build clean, pod installs and updates. I have not found a solution.
Shell Script Invocation Error Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/Anti-Social: No such file or directory
I have similar issues in the past and doing the following work for me. Hope your problem is same as mine:
Close xCode
Go to this folder Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/
and delete Anti-Social.
Restart xCode, clean & build.
It is hard to really tell you the solution with just the information provided. However, the first thing I would try is deleting the derived data, as CodeBender stated. You should also look at your search paths in your project's building settings to make sure your pods are correct/ connecting your pods files to your project.
Possible duplicate of:
Xcode 8 Shell Script Invocation Error
Here is what I did when I got this:
Used this site to completely remove All Versions of cocoapods:
https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
Re-installed current stable version of cocoapods (v1.1.1 for me)
Deleted podlock and pods directory
Deleted old .xcworkspace file (this was key for me).
Did "pod install"
Opened xcode and cleaned project and deleted derivedData.
Go to your build phases and remove libReact.a from the linked libraries.
Then add libReact.a but select this one:
libReact.a from 'React' target in 'Pods' project

Cocoa: Command /usr/bin/ditto failed with exit code 1

I am trying to build my project but it is not getting build.
I am getting the following error:
Command /usr/bin/ditto failed with exit code 1
I have cleaned my project but still is issue is persisting.
Xcode Details:
EDIT Solution tried
I went to
~/Library/Developer/Xcode/DerivedData
and deleted everything inside the folder then went back to the Xcode and tried to build the solution. Getting the same error back
Command /usr/bin/ditto failed with exit code 1
clean your project and see whether it help or not
Command + Shift+ K
or
Product > Clean
Or check this link it may helps you: http://codica.pl/2015/12/25/taming-swift-compiler-bugs/
For Mac OS Sierra, this work for me:
cd /Users/YOUR_USER_NAME/Library/Developer/Xcode/DerivedData
then
xattr -dr com.apple.FinderInfo *
and then rebuild your project..
and fix the error!
All of sudden, It happens to my Mac app project today in Xcode 7.3.1.
What I did :
Clean >Clean build folder > Quit Xcode >Open Finder then go to
~/Library/Developer/Xcode/DerivedData
then deleated everything inside >Open Xcode >Build >Run
I think this is happening when something is wrong adding a file into Xcode.
I have not encountered since readding myApp.help file without the option 'Destination: Copy items if needed'.
Look at the error messages and find out which files are affected. Delete these files (remove references) and then add them again to your project's target. It should work now.
Follow this steps:
clear "Derived Data" from files.
Xcode >> Preferences >> Locations >> click on arrow icon(opened "DerivedData" folder)
remove/delete all files from "DerivedData" folder.
clean project(cmd + swift + k)

Malformed or corrupted AST file

I have a problem I don't know why did it happen in the first place but most probably because I've pressed move to trash to some system frameworks by mistake.
I got an error that says:
malformed or corrupted AST file: 'could not find file '/Users/username/myProject/QuartzCore.framework/Headers/CAMediaTiming.h' referenced by AST file'
I've tried to copy QuartzCore.framework in that Directory. It give me then a punch of new errors. Then if I remove the framework from the Dir. Everything will be good for the project till I make any code change. Then I would have to make the previous scenario again. It's very annoying now and I really need to fix this. Anyone?
As requested:
What caused this error for me (after getting the new Xcode) was I would try to run a project in simulator (accidentally in simulator, I never use simulator), but I'd forget to select my device or my device would become unplugged without me noticing, and it will try to run in simulator... so I would get those classic ".o" file errors... Then I would switch back to my device and get corrupt AST files...
To CURE the problem... (Follow the steps below VERY closely!!!!!)
Clean your project
QUIT Xcode (CMD+Q)
Run this Terminal Command: rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
Run this Terminal Command: rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/*
Reopen Xcode
MAKE SURE YOU HAVE YOUR DEVICE SELECTED AND NOT SIMULATOR
CLEAN project (Yes, again)
THEN build (to your device, not to simulator)...
Enjoy!
Note: After further experimentation I've found that the force-quitting of xCode is possibly not necessary.
In addition to all of the other "clean your build" answers, nothing was working for me until I emptied out the (highly undocumented!) /var/folders directory.
Apparently, this is a "miscellaneous caches" dir maintained by OS-X. I didn't even bother figuring out what were "the correct files"; I just cleaned out the entire directory.
...And now I can build again. Hooray! From terminal:
[sudo] rm -rf /var/folders/*
(Although I did it from Finder, via authentication.) (OS-X 10.9.latest)
Additional clue: I could build with XCode-6-beta, but got the goofy "corrupted AST file" error in XCode-5.
In my situation, all I needed to do was click Product > Clean, then build the project again. It succeeded. Hope this helps some others who run into the same situation.
Hi all I got the same error because I have opened two projects at a time and drag and dropped frameworks from one project to another .
After some time I realised that this is not a right way. I moved all frameworks which are dragged from another project to trash. Then clean and run in simulator everything is working fine.
Delete frameworks->again add frameworks->clean and run
I hope it will help someone
Personnaly, just one solution worked for me:
In Xcode Go to Window -> Organizer
Clic on the "delete" button near the "derived data" directory.
Then Run again your project...
I just clean my project and re-build. Everything back to normal.
In my case, the error was happening because I had a corrupted .m file - it was one that had, somehow (not quite sure how) found its way into my project (I had Eclipse open at the same time and the corrupted file had some java code in it). To fix the problem, I cleaned my project, closed Xcode, deleted the erroneous .m file & re-opened Xcode. It then gave me a clang error due to the now missing .m file. I created a new, empty .m file with the same name and the project ran fine. Bit of a hack but it worked :-)

Resources