Unable to compile dependencies on Xcode 13 - xcode

The error: "Command CompileSwiftSources failed with a non-zero exit code"
Cause: Simply messing with 2 Xcode installs by installing both Xcode 13 and Xcode 14 beta (with Xcodes)
Consequences: First, Xcode lost connection with SwiftUI Previews device. Then compiling issues occur. All simulators were also gone from the list. The error keeps showing up for each dependency of the project.
Unsuccessful attempts to solve this:
Uninstalling Xcode by moving it to trash, even performing a clean-uninstall with CleanMyMacX
Manually wiping every Xcode-related file possible (browse the internet or perform a find / -path "*Xcode*" 2> /dev/null)
Recreating a brand new project and moving all previous Swift files into it
Removing and re-adding a bunch of times all my dependencies
Solution: Check the answer below.

The solution came from nowhere. I was trying to open Xcodes to check which versions were installed on the Mac when I accidentally pressed enter on the wrong Spotlight result: Xcode Server Builder.
I have no clue what that is, but I assume it's an embedded Xcode component used for compilation. That is, I opened it and it prompted me some Accessibility access request. I fulfilled it because why not, and I tried by curiosity to compile with ⌘+B, and it worked.
About the empty list of simulators, I simply downloaded the latest available iOS 15.4 Simulator, and every device showed up as before.

Related

iOS project changed to macOS and unable to compile code

Buildi info : https://imgur.com/a/VIAf4kt
The base SDK is set to iOS. But unlike before, I am unable to select iOS version instead it forces macOS on me. I think this is the reason I am unable to compile and get the following error: https://imgur.com/wJzCbKp
Attempted: Restart XCode. Switch to macOS and back to iOS.
EDIT: looks like all my other projects are set for macOS now. All of them have iOS as selected build settings and deployment target. Don't know why it is not syncing up.
Looks like it was an XCode update that prevents the APIs from linking up. I guess is Apple's way of blocking outdated xcode versions. I had to force quit xcode and all other projects running on Xcode. Then re-open xcode and the update for v.12.3 prompts and now everything is back to normal.
If you get the error, chances are your xCode is out of date because apple released a new version very recently. Try everything to find/ get it to update.

Xcode 8 freezes on Signing product

I can no longer access any storyboards or XIBs in my project. As soon as I do,Xcode starts building and when it gets to Signing product it just hangs. I left it open for about half an hour, nothing happens. I need to Force Quit every time.
Signing works otherwise thou, that's the weird part. I can build normally, I can run on simulator, device, I can archive, everything is fine, EXCEPT when I open an IB file.
I tried all the usual, deleting DerivedData, cleaning everything, nothing seems to work. This is extremely frustrating and I can't find anything on the subject.
I'm using Xcode 8.2 beta (8C30a) currently, but it's also happening in the release 8.1.
Can you file a bug report with a bit more info? Please provide a copy of the build log and the output of sysdiagnose Xcode (it will produce an archive).
http://bugreporter.apple.com/
Thanks!

Xcode 8.0 Simulator broken

Something has gone wrong with my Xcode install... I was running my app and seeing odd behaviour within the app itself, for starters I wasn't able to run the build in the simulator.. it'd install and never launch, eventually putting up a dialogue box about being unable to bless the connection to the simulator. I'd had this problem a few days before but it eventually went away, googling just revealed people having issues with the beta builds or beta MacOSX.
Eventually today I rebooted my Mac and having done so, launching Xcode gave me some other error about the simulator, which I didn't properly take notice of. Since then my project no longer lists any simulators to deploy with, if i try to add new simulators the button to add the simulator does nothing and I have to cancel the dialogue box. If I try and run the simulator or watch simulator directly it just beach balls indefinitely and i have to force kill it.
I've created a new user account and within that made a new Xcode project, which also has no simulators.
I've got a zipped backup of my Xcode from before this problem occurred which I've extracted and swapped in place and it makes no difference.
I guess I could do with redownloading the app off the AppStore in hope that the installer would do something to fix this problem.
Anyone got any thoughts on other things I can try?!
Cheers
What is most likely to be the case is that your XCode installation is corrupt. The best thing to do is to delete Xcode entirely and also these directories and files:
~/Library/Caches/com.apple.dt.*
~/Library/Caches/xctest
~/Library/Containers/com.apple.dt.*
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.*
~/Library/SavedState/com.apple.dt.*
Then reboot your system and reinstall Xcode. Hopefully that should have cleared out the issue.

Why iPad app build fails in xcode with a error creating temporary directory?

I'm using Xcode 4.6, and trying to run a simple app in iPad 6.1 Simulator, build fails with error message
mkdir: /Users/chakradar.r/Library/Developer/Xcode/DerivedData/dino-eddkhtnsnrlgwjgqnaceabrxcjsh/Build/Products/Debug-iphonesimulator/dino.app/wwwof: File exists
that is a temporary directory, i even tried building it after removing the directory, it again fails with a similar message.
Once my Xcode went unresponsive so I force quit Xcode while this application was running, I suspect that could be the reason for the failure. Error message is not helping, how can I fix this situation?
While I don't know the exact reason you're getting this error. Here are some generic steps that you can try in these situations:
In the simulator app go to 'iOS Simulator' (in the top menu), choose 'Reset Content and Settings...'
In Xcode go to 'Product' then 'Clean'
In Xcode go to 'Window' then 'Organizer', click on the 'Projects' icon on the top, find your project in the list on the left and click 'Delete...' beside the 'Derived Data'
Restart your Mac (Yes, sometimes this really resolves some issues)
You can try any of these options individually or all of them.
I too even don't know the exact root cause but
Killed both Xcode and Simulator and ran the app again and it started working for me.

Xcode 4 Error: Error Starting Executable

I ran into problem with testing my app on iOS and Xcode when I am uploading it to my actual devices (iphone and iPad), and I'm wondering if someone knows the issue and can help me out:
Normally when I build my app on my devices, the app is installed and launched on my devices. But as I am preparing for submitting my first app I was testing around and changing the Bundle Identifier, App ID, and Development Provisions (so the issue may have something to do with it), and now, when I try to build my app on my devices, although it's installed on my devices fine, Xcode will not launch the app anymore. Instead, I got this error message:
Error Starting Executable.
Error launching remote program: No such file
or directory.
Does anyone know what the issue is? And What is this derived data folder about?
Much thanks!
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
Running App from a Clean Slate
For me the problem did not resolve until I did the following in this order:
Delete the app from the device (Do this before trying to debug again)
Quit XCode (Don't just close the project)
Delete the app build folder (example path: /Users/myusername/Library/Developer/Xcode/DerivedData/MyProject-fhkaamuyvqhubaezinqbmxbnaufd/)
Restart XCode
Finally -- Try debugging again on the iOS device
The app build folder of step 3 refers to your app's build folder that is a child of "DerivedData". To find this you can reveal your app in finder, then backtrack until you get to "DerivedData" folder and delete the folder above that like "MyApp-crazylongweirdletters". Without this step (3), I could not debug, so this is a critical step and you must quit XCode before you do this step.
For some it appears simply restarting XCode does the trick, but not for me.
I only post this answer because the earlier answers did NOT work for me. Hopefully others banging their heads will find this and get a sigh of relief. :)
Notes:
The issue started happening for me when I modified the bundle id of the app.
My code signing is and was correct. My provisioning profile was the "Team Provisioning Profile" which should work for any app id (default for "iPhone Developer" automatic profile selector).
I was doing a DEBUG build (not release / distribution).
You cant debug (start from Xcode) an application signed with a distribution profile if I remember well... And then you get such messages, gdb failling to attach to process.
I finally found my error!
I was playing around with my info.plist file, and I changed the Executable Name and Bundle and Bundle Display name! As soon as I changed those back to the Defaults (EXECUTABLE_NAME, PRODUCT_NAME, PRODUCT_NAME respectively) it worked perfectly.
Delete the app from the device (tap-and-hold then delete) and try again.
For me, none of those worked. Same error, but different solution.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
The fix was simple - drop the deployment target to below or equal to the ios software version on my phone :)
I got the same error by not having my code signing correct.
Go to your project > Targets > Build Settings > Check code signing for debug state.
I stumbled upon this as a solution to another issue whch was a warning when trying to build an app on a new 4.3.5 device.
If i set the profile to distribution I do not get a warning message when building the app, but the debugger will attach to the device.
If i set the code signing to the distribution profile, i get no warnings in the build process, but the debugger will not attach. So the answer above about being signing based seems to be correct. This might also only be an issue on newer 4.3.5 devices with xcode
Product -> Clean in the menubar
This error some times happen due to incomplete "Restore" or "Sync" process of your device which keeps the .app files locked up.
What I did I had to jailbreak my device to go find the app under /User/Applications/XXXXX-XXXX-XXX/ and phisically delete the .app
For one of the apps it worked and for other one I realized it just does not run GDB automatically so the error message is totally misleading, so I set the GDB to manual and it worked and did not give me that error, but of course I have to run the app manually for the debug session to start.
It also may have required some other stuff that I did before like checking the provision profile, but this was the last step that made it work.
Before this I tried all the solutions did not work for me, and obviously simply deleting the app by holding down your finger on the screen did not work, as it removed the icon but all the files were still there. ( Since it was a development app not a downloaded App Store app )
had same problem,
quit the XCode...delete app from device...run the program again..
i solved that way..one of my friends had to restart the device.
I have the same problem. I solved it by changing the project's directory name and then launching the app again.
I had this problem on a recently restored device where my in-development apps had not been reinstalled—they were showing up on Springboard as "Waiting" to be downloaded from the App Store. Deleting the app from Springboard fixed the problem.
I've faced this issue since yesterday on two different devices, both iOS 4.x. Deleting the DerivedData folder, deleting the app, restarting the Xcode, and cleaning the code did NOT work. Repeating all the steps, in addition to rebooting the device fixed it for me.
Here I am posting an update to the issue. Might be helpful for someone with the same problem. I have Xcode 4.4 and launched it on a device with iOS 5.0 . If Xcode doesnt have the 5.0 simulators

Resources