Xcode 8 no longer builds to device - ios

I'm currently running Xcode 8.1 beta and have a stable release of Xcode 8 installed as well.Out of nowhere, without modifying any code inside the project, I am unable to build my project and run on a device.iOS version is 10.1 beta but the issue was not present when originally working with this version. Xcode 8 and 8.1 are experiencing the same issue and I previously did not have a problem running the project on a physical device.The provisioning profiles were up to date and I created new ones throughout the troubleshooting process.I have also gone through the basic troubleshooting options (restart the machine, restart the device, cleaned project, tried different lightning cable/USB port, reinstalled Xcode, and deleted Xcode preference files).The project builds and runs very quickly to the simulator and when attempting to run on the device I received no errors.When trying to run on a device, the build goes through the first tenth of the process and just sits there until I cancel it. I've even created new test projects to test against a known good and the issue persists.If anyone has experienced, a similar issue your insight would be greatly appreciated.

I was facing the same issue but installed latest Xcode 8.1 and issue got resolved

When you have multiple versions of Xcode installed the command line tools loses track of which Xcode to run. Make sure that this is set. Having multiple versions has always been troublesome for me.

The issue ended up being with a large number of dictionaries. The compiler was attempting to go through a rather large number of dictionaries and was unable to complete. I restructured my data model and the issue was resolved.

Related

Building/archiving for release hangs indefinitely in Xcode 11

I'm trying to release an iOS app - it builds fine on simulator or device in Xcode 11, and can be archived fine in Xcode 10, but when I try to archive it for release in the App Store the build hangs indefinitely. I hit Product > Archive, it completes 3960 out of 4040 steps, and then hangs in indefinitely at the stage of "Archiving Firebase/Firestore". This is happening on 4 different Xcode 11 versions - 3,6,7 and most recently the GM that was released earlier today.
I've tried flipping a bunch of the build settings - the Optimization flags, incremental/whole modules, enabling Bitcode, exclusive memory, and have also reinstalled Xcode with different 11 versions a few times. I've also tried this with various versions of cocoapods, including the Firebase/Firestore pod that is being compiled when the build hangs (i.e., I've used an old version and tried updating to the latest version of the pod) Nothing I've done has worked. Does anyone have any advice for other things I could try to stop this from hanging?
#leonluc-dev tracked this infinite loop down to a Swift compiler bug building the SwiftSoup CocoaPod.
Full description here.
See this answer for a screen shot of disabling optimization of Swift Soup to work around.
It seems to be a bug with Xcode 11. I reported the issue to the Firebase team over here:
https://github.com/firebase/firebase-ios-sdk/issues/3884#issuecomment-533663539
and I also reported the issue to Apple using feedback assistant (bug FB7303206). I'll update this answer when Apple responds.
If you're also using Firebase Crashlytics, moving
"${PODS_ROOT}/FirebaseCrashlytics/run"
after
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols"
in your Run Script phase should solve the issue.

Xcode 11 GM Seed 2 freezes while building workspace/project

I have recently downloaded new Xcode 11 GM Seed 2 so that i can update my project to support Dark mode. (I am already on MacOS Catalina latest beta version-19A558d).
I have my project(workspace with pods) working 100% fine with Xcode 10.2. When I have started building same project with newly installed Xcode 11 GM Seed 2, It randomly freeze while building with title Building X of Y tasks. It randomly stops building any file at anytime. As per my different observations, It stops building while it is building library from my Pods.
I have already tried cleaning, manually deleting derived data files. Also, i have tried by reinstalling Xcode. Also restarted Mac to give try. All trial get failed. If anyone faced same issue and know the solution, please post here.
Disable the Swift Optimizer for SwiftSoup:
I were trying all day hard to solve this issue. Finally issue get resolved.
Actually i tried to build/compile the app via Terminal. Then i found that it got struck/freezed while compiling the files from installed 3rd party libraries from pods. The 3rd party library named SwiftSoup was making problem. Then i removed that pod, and commented out the code related to that. And tried compiling/building the app again. And It worked successfully this time.
UPDATE:
I followed #Paul's Answer, that works without removing pod, keeping same pod and code working. Just need to update settings as described by him. But make sure, that you need to change this setting every time you update your pods.

ITunesConnect rejecting build even though I'm on normal Xcode version

I'm getting the following error and don't understand why I am getting it. I'm running Xcode 7.2.1 which is the normal released version and was able to upload builds earlier this week with this same Xcode version so this error makes no sense. Has anyone else encountered it or figured a way to get rid of it? I've tried the following:
Restarted Xcode
Deleted Derived Data
Restarted Computer
Ran Build Clean
Ran Build Folder Clean
Incremented versions on the build.
Any other ideas on how to fix this?
I've figured out what was wrong with it, and it is definitely my fault. As stated in the error message:
Don't submit apps with Beta software including OS X builds
Xcode was on the correct version but my OSX had auto updated the night prior to this appearing, and put my entire system on a beta. There is no easy way to revert if you didn't do a time-machine save prior to updating (mine happened automatically, so I definitely didn't). Now I'm stuck building on my back-up mac until Apple releases 10.21.4 publicly.
Thanks for the help, lesson learned. Don't register for any beta software unless you have Time Machine setup to automatically backup your machine.
UPDATE
Reinstalling your OS when you are on BETA is actually quite easy.
Go to the Mac App Store
Search for "OS X El Capitan" or whatever OS you need
Hit the Download button
Now you can reinstall your OS. Stupid easy.

Xcode crashes repeatedly on both 7.2.1 and 7.1.1 versions

I installed Xcode 7.2.1 and it crashes every time I try to type some code, then a box titled "Xcode quite unexpectedly" containing details appears. I uploaded the whole details here:
http://pastebin.com/KZCRntiT
I also installed and older version of Xcode (7.1.1) to see if the problem is due to the version or not, and found that the older version also keeps crashing every time I write some code.
This is not the case for a specific project, it crashes on both current and new projects.
If the other answer doesn't solve your problems, delete the file of ~/Library/Cache/com.apple.dt.Xcode and nuke in ~/Library/Developer/Xcode/ at least DerivedData if not the rest of the files as well. Have Xcode closed when you do it.
I had the same issue. I unplugged all of my devices, opened XCode, and close all tabs individually. I think there was an issue with one of my tabs. Everything is working now.

Xcode 7 ValidateEmbeddedBinary error Could not read data in foo-WatchKit-App.app

I am trying to do a full build on an iOS App with a WatchKit App as well.
When compiling the full project for Archive I am seeing the following
ValidateEmbeddedBinary DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
cd /Users/lordandrei/Projects/git/X7/lifa93
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-embeddedBinaryValidationUtility /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app -signing-cert *9F…FB* -info-plist-path /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/InstallationBuildProductsLocation/Applications/lifa93.app/Info.plist
error: warning: Could not read data in /Users/lordandrei/Projects/git/X7/lifa93/DerivedData/lifa93/Build/Intermediates/ArchiveIntermediates/lifa93Dev/BuildProductsPath/Release-iphoneos/lifa93.app/Watch/lifa93-WatchKit-App.app
I have tried:
toggling between Debug and Release
toggling No Install and No Validate.
revoking and replacing all profiles (Signing, adhoc, dist)
So far nothing has made a dent.
Suggestions welcome as I am in a holding pattern trying to build.
Xcode: Version 7.0 beta 3 (7A152u)
iOS: 9.0 beta 3 (13A4293g)
Radar: 21975256
I had this issue when I was trying to build to my iPhone 6+ and Watch. I had just re-installed Xcode 7 Beta because I accidentally deleted one of the needed frameworks. I tried building several times and received the same "Could not read data..." error. I finally built to the simulator successfully, AND THEN built to both devices and it worked.
My issue now is that builds to Apple Watch seem to take forever to run or pass "Attaching...".
I don't know exact reason of your problem, but I created new project that includes WatchKit App target as well. And it works fine, no problems with building process.
I am using Xcode 7 beta (7A120f).
That's why I propose 3 potential ways to resolve the issue:
1. Create new new project from scratch and migrate source and resource files from your current project to new one. I had similar problems (it wasn't related to WatchKit app) previously and this trick helped me.
2. Install latest version of Xcode. Xcode 7 beta 4 is released on 21st of July.
3. Install Xcode (7A120f). This is version that I am using, you are using different one. I don't think that it will help, but who knows.

Resources