Xcode 7 beta - build error (xcassets) - ios

I was just install Xcode 7 beta and converted my Swift project with Swift 2 guidelines.
Build is OK but xcassets: I reached this error in logs:
CompileAssetCatalog /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app {...}/Images.xcassets
cd /Users/phoenix/Dev/Xcode/{...}
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/usr/bin/actool --output-format human-readable-text\
--notices --warnings --export-dependency-info /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_dependencies.txt
--output-partial-info-plist /Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Intermediates/{...}.build/Debug-iphoneos/{...}.build/assetcatalog_generated_info.plist\
--app-icon AppIcon --launch-image LaunchImage --compress-pngs\
--enable-on-demand-resources YES --target-device iphone --target-device ipad\
--minimum-deployment-target 7.0 --platform iphoneos --compile\
/Users/phoenix/Library/Developer/Xcode/DerivedData/{...}/Build/Products/Debug-iphoneos/{...}.app\
/Users/phoenix/Dev/Xcode/{...}/Images.xcassets
/Users/phoenix/Dev/Xcode/{...}/Images.xcassets: error:
Failed to find a suitable device for the type SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 with runtime SimRuntime :
9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0
Failure Reason: Failed to create new simulator device that matches SimDeviceType :
com.apple.CoreSimulator.SimDeviceType.iPad-2 for runtime SimRuntime :
9.0 (13A4254u) - com.apple.CoreSimulator.SimRuntime.iOS-9-0 ((null))
UPD:
Now when I try to launch iOS Simulator from "Open developer tools" menu from dock I reach this error:
Dyld Error Message:
Library not loaded:
#rpath/SimulatorKit.framework/Versions/A/SimulatorKit
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Conte‌​nts/MacOS/Simulator
Reason: image not found
UPD2:
When trying launch simulator from terminal got warning:
$ Applications/Simulator.app/Contents/MacOS/Simulator
dyld: warning, LC_RPATH #loader_path/../../../../Library/PrivateFrameworks in /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator being ignored in restricted program because of #loader_path
dyld: Library not loaded: #rpath/SimulatorKit.framework/Versions/A/SimulatorKit
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
Reason: image not found
I think this is a main issue...

Navigate to ~/Library/Developer/CoreSimulator/Profiles/Runtimes, then remove the runtime - the runtime is old. After, reboot Xcode7, and launch the Simulator...
Further explanation from #seancook:
I experienced this, too, on El Capitan. NIBs wouldn't load, no Sims
present, and unable to launch Simulators through the Xcode/Open
Developer Tool/Simulator menu. After fighting it for a few hours I've
finally got it working.
Here's what worked for me (YMMV): I
noticed a message in Console.app along the lines of the Simulator
runtime not being code signed. I went to the path it described
"/Library/Developer/CoreSimulator/Profiles/Runtimes" and removed the
runtimes that I had there. They were old runtimes, so I assume that
some check in Xcode now applies that didn't previously. Who knows?
After doing this, I could finally launch the Simulator via the
Xcode/Open Developer Tool menu. Unfortunately, the Simulator still
wasn't being shown as a run target in my workspace, so I kept
spelunking...
I then went into the Simulator's Hardware/Devices/Manage Devices menu and added a new iOS9 device. It didn't seem to do anything, so I quit out of Xcode and Simulator.app.
I then re-started Simulator.app (via Xcode/ODT/Simulator) and lo and
behold the expected iOS9 simulators were displayed. I closed and
re-opened Xcode, changed the target OS for my project, and the Sims
were finally displayed as run targets.

I was using an older xCode ( I have 8.3.1 installed by appstore and I was using 8.2.1).
For me, the solution was Xcode/Preferences>Locations and setting Command Line Tools: Xcode 8.2.1 (8C1002) (it was on the newer Xcode before)

I just cleared the derived data and it works fine now.

Related

dyld_shared_cache_extract_dylibs failed while trying to run app on iPhone

I ran into a problem trying to run my app on my iPhone using Xcode. The app builds successfully but returns "dyld_shared_cache_extract_dylibs failed" error when trying to run on my iPhone.
dyld_shared_cache_extract_dylibs problem
The problem started when I updated my Xcode and ios to the latest versions i.e 10 and ios 12 respectively.
I've tried a few things from research and what other threads have suggested:
- Reinstalling Xcode and my operating system.
- Deleting the ios version from the xCode packages which resulted in a different problem.
I am having the same problem with iOS 12.1 and xcode 10.1 on MacOS 10.14.1. I tried all the other methods provided by various sources. The one suggested by jblaauboer above is the only solutions that actually worked. It is not the xcode application itself, but some other configurations associated it caused this problem. Reinstallation of xcode from app store after a clean uninstall using CleanMyMac 3 resolved this issue.
This error occurred when I have upgraded & added new Xcode 11.2.1 from old Xcode 10.2.1.
Steps to follow (Video URL: https://www.youtube.com/watch?v=m3jST08imY0):
Open Devices and Simulators
Remove your device from the list
Tap the + button on the bottom left of the window
Select the device (before tapping Trust on it)
Tap Trust on the device
After this if you get same error then do following:
I have just copied additional iOS DeviceSupport from Xcode 11.2.1 and added to Xcode 10.2.1 and error gets solve for me.
(Note: While doing this please quite Xcode and then try to run)
Path: ⁨MacOS⁩ ▸ ⁨Applications⁩ ▸ ⁨Xcode 10.2.1.app⁩ ▸ ⁨Contents⁩ ▸ ⁨Developer⁩ ▸ ⁨Platforms⁩ ▸ ⁨iPhoneOS.platform⁩ ▸ ⁨DeviceSupport⁩
In my case I was just running out of disc space (Xcode 10.1, iOS 13.3). Everything was fine after I made some space.
The error message might be misleading.

Xcode 10 test failure when running on older iOS simulators - "Failed to load test bundle... no suitable image found"

I've installed Xcode 10 and upgraded my iOS application to Swift 4.2. When I run my tests (both UI and Unit) via Xcode, on an iPhone simulator running iOS 12, the tests successfully start. When I attempt to run the tests on a simulator running a prior iOS version (e.g. iOS 10.3.1), I get a "failure to load the test bundle". These tests were running successfully on Xcode 9.4. I can run my app on this older simulator without an issue.
The Xcode output is as follows ("Reading List" is the application name):
2018-09-16 15:11:36.667 ReadingList[11401:11478426] Failed to load test bundle from file:///Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests): no suitable image found. Did find:
/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests: mach-o, but not built for iOS simulator" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests, NSDebugDescription=dlopen_preflight(/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests): no suitable image found. Did find:
/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests: mach-o, but not built for iOS simulator, NSBundlePath=/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest, NSLocalizedDescription=The bundle “ReadingList_UnitTests” couldn’t be loaded because it is damaged or missing necessary resources.}
The line mach-o, but not built for iOS simulator seems like it could be key. How can I resolve this?
The test targets had the iOS Deployment Target setting left as the default value.
In Xcode 9.4, this is equal to "iOS 11.4", yet the tests can still be run on an "iPhone 7 (10.3)" simulator for some reason. In Xcode 10, there seems to be a change in behaviour since the tests no longer run on simulators running iOS versions prior to the default "iOS 12".
In the Project Navigator, select the project file.
Select the Target in the Project configuration window.
Select Build Settings tab, (Basic and Levels)
Scroll down to iOS Deployment Target and then select the desired OS version.
That solved the problem for me.
cheers
rgds Dave

Xcode 10 GM libstdc++ error, can't run on simulator

I am trying to test my apps for iOS 12. I have a iPad only app that works fine under Xcode 9. When I try to compile it for the simulator with Xcode 10 GM, the following warning appears:
URGENT: building for iOS Simulator simulator, but linking against dylib (/usr/lib/libstdc++.6.0.9.dylib) built for macOS. Note: This will be an error in the future
It will build, but when running it crashes with the following message:
dyld: lazy symbol binding failed: can't resolve symbol ___cxa_guard_acquire in /Users/.... /.... xxx.app because dependent dylib #1 could not be loaded.
I haven't done anything, it happened on the first try.
Any ideas?
removed '/usr/lib/libstdc++.6.0.9.dylib' from the 'OTHER_LDFLAGS', seems to be fine again.
libstc is removed in iOS 12 and was first deprecated in Xcode 10. You can however manually add this library in Simulator or update your dependency to use libc++.
Refer this link for manually adding these libraries - libstdc

Xcode 7.0 beta 6 crashes when app is run in the simulator with "Xcode quit unexpectedly." error

My app is crashing in Xcode 7.0 beta 6 when I run it in the simulator with following error message:
Xcode quit unexpectedly.
Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
Here is my crash report:
http://pastebin.com/YechkXrm
Things I noticed:
The crash happens 100% of the time so I am unable to run my app in the simulator or execute unit tests.
Same app does NOT crash on a different computer running identical OS X and Xcode versions.
A different app did not crash.
What I tried so far:
Reinstalling Xcode.
Reseting content and settings of the simulator.
Clearing ~/Library/Developer/Xcode/DerivedData and ~/Library/Caches/com.apple.dt.Xcode/ directories.
Deleting and adding the simulator from Window > Devices.
Xcdode > Preferences > Source Control > Uncheck the Enable Source control.
Selecting "Command line tools" version from Preferences > Locations.
Restarting my computer.
I did submit a bug report to Apple.
Xcode Version 7.0 beta 6 (7A192o)
OS X Version 10.10.5 (14F27)
Mystery solved
I found out the source of the problem. I am using Carthage to build frameworks. To solve this problem I needed to run carthage update. I think that last time I did that I did not commit the built framework files from Carthage/Build directory. And maybe when I installed newer Xcode version it caused the problem with the framework files there were built using previous command line tools.

iOS Simulator 8.1 SDK missing in XCode 6.2

Developers I'm supporting just got new Macs with XCode 6.2 (Version 6.2 (6C131e)).
In running xcodebuild we're having failures in running against any earlier version of the simulator, even if it's been downloaded, getting:
:build
xcodebuild: error: SDK "iphonesimulator7.1" cannot be located.
:build FAILED
I go to Xcode -> Preferences and download the iOS 8.1 and 7.1 simulator, but still they don't show when doing an xcodebuild -showsdks:
xcodebuild -showsdks
iOS Simulator SDKs:
Simulator - iOS 8.2 -sdk iphonesimulator8.2
Ideas? I can't flip my whole project & CI pipeline to build against 8.2 just yet, wondering if there's a trick to getting the 7.1 / 8.1 sim working from the command line tools in Xcode 6.2.
It looks like Xcode 6.2 is having an issue recognizing any additional simulators:
xcodebuild[4554:1175053] [MT] iPhoneSimulator: SimVerifier returned: Error Domain=NSPOSIXErrorDomain Code=53 "Simulator verification failed."
UserInfo=0x7fe952514ca0 {
NSLocalizedFailureReason=A connection to the simulator verification service could not be established.,
NSLocalizedRecoverySuggestion=Ensure that Xcode.app is installed on a volume with ownership enabled.,
NSLocalizedDescription=Simulator verification failed.}
Some in the Apple Developer Forums are experiencing the same issues. A radar has been filed, and one possible solution of:
"Finally success by nuking /Library/Deverloper/* and re-installing Xcode."
Found the answer in this thread: xcode simulator not coming up - reinstall possible? (the accepted answer). Looks like xcode 6.2 is not "smart" enough to create the simulators on its own. This is why, if you update from 6.1 to 6.2, you won't be able to see ios 8.2 simulators even if you have the sdk, and the same reason why if you do a clean install you can't see any simulator at all, even if you specifically install the simulators in the preferences menu. Cheers for the poorly packaged official bundles!
I found this issue too. But my method is to copy the simulator into the SDKs folder and this work at Xcode 6 earlier versions. After I upgrade to xcode 6.2, I found this method did not work anymore.

Resources