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
Related
I have a source code of an app that is live in iPhone (for OS iOS 7 and before) and it is not supported in iOS 8.0 and later. When I tried to compile the code it is executing all the files fine, but it is throwing an architecture mismatch error.
In console:
dyld: dyld_sim is not compatible with the loaded process, likely due
to architecture mismatch
I tried adding valid architectures (armv7 armv7s arm64) in Build settings for both iPhone and Xcode iOS simulators. Still doesn't fix the issue...
Please help me...
I am using Xcode 9.2.
Valid Architectures
Follow the steps below. Hope it will work.....
Change Deployment target to recent one like >= 9.0
Select Standard architectures for Architectures from Build Settings> Architectures
For the first time I was able to compile my app in Xcode 7 (failed in beta 4 and 5). So, thats good progress I guess.
However, when i load my app on my iPhone 6, iOS 8.4.1, it crashed in the debugger with the following message:
dyld: Symbol not found: _NSArray0
Referenced from: /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Is this something to do with the order of the libraries being linked? Look forward to some advise.
Thanks!
I fixed it by putting this in the podfile. platform :ios, '8.4'
No need to update your device to iOS 9 and lose out on 8.4 testing.
I had the same error and I fixed.
I removed CoreFoundation.framework and Add again with Status "Optional" and works.
If anybody else got this while running unit tests do the following:
Select unit tests target
Go to Build Settings
Search for 'Deployment Target'
Change Deployment Target version to your project's deployment target
That's it!
I also had this problem and I fixed it by adding framework CoreFoundation.framework to Build Settings.
This as a problem on iOS8 build with the new XCODE release, Please remove CoreFoundation.framework and Add it again with Status of "Optional".
I used to have the same error during compilation of a mac os project after updating the Xcode for 7.0 GM version (7A218). Xcode 7 has the 10.11 sdk in it only (you could check that in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, where it's a MacOSX10.11.sdk).
At compilation time the xcode will link the frameworks from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks, but at runtime from /System/Library/Frameworks/ as I guess.
I have OS X 10.10.5 (14F27) on mac. Either I have my static library that I've built by xcode 7 (MacOSX10.11.sdk as you remember from earlier), which I've linked to my project after. After running I got the runtime error as
dyld: Symbol not found: _NSArray0
I think it's because the library has been compiled with CoreFoundation.framework from mac os sdk 10.11, but at runtime was linked to CoreFoundation.framework from /System/Library/Frameworks/ where version of which is 10.10 (as OS version).
How I fixed this. Friend of mine has xcode 6 yet, I took mac os sdk 10.10 from there (as you remember in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, name is MacOSX10.10.sdk) and added it to Xcode of mine. Then I rebuilt my static library with 10.10 sdk (you could compile from cli with '-sdk macosx10.10' parameter or set build sdk in Build Settings => Base SDK). After the problem has been solved.
I assume that for the iOS you could apply the same strategy.
I experienced the same exact crash running Xcode 7.0 beta 6 on a device with the first iOS 9 beta installed, the crash however was not occurring while using the simulator.
After updating my iPhone to iOS 9 beta 5, the crash stopped.
For the first time I was able to compile my app in Xcode 7 (failed in beta 4 and 5). So, thats good progress I guess.
However, when i load my app on my iPhone 6, iOS 8.4.1, it crashed in the debugger with the following message:
dyld: Symbol not found: _NSArray0
Referenced from: /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Is this something to do with the order of the libraries being linked? Look forward to some advise.
Thanks!
I fixed it by putting this in the podfile. platform :ios, '8.4'
No need to update your device to iOS 9 and lose out on 8.4 testing.
I had the same error and I fixed.
I removed CoreFoundation.framework and Add again with Status "Optional" and works.
If anybody else got this while running unit tests do the following:
Select unit tests target
Go to Build Settings
Search for 'Deployment Target'
Change Deployment Target version to your project's deployment target
That's it!
I also had this problem and I fixed it by adding framework CoreFoundation.framework to Build Settings.
This as a problem on iOS8 build with the new XCODE release, Please remove CoreFoundation.framework and Add it again with Status of "Optional".
I used to have the same error during compilation of a mac os project after updating the Xcode for 7.0 GM version (7A218). Xcode 7 has the 10.11 sdk in it only (you could check that in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, where it's a MacOSX10.11.sdk).
At compilation time the xcode will link the frameworks from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks, but at runtime from /System/Library/Frameworks/ as I guess.
I have OS X 10.10.5 (14F27) on mac. Either I have my static library that I've built by xcode 7 (MacOSX10.11.sdk as you remember from earlier), which I've linked to my project after. After running I got the runtime error as
dyld: Symbol not found: _NSArray0
I think it's because the library has been compiled with CoreFoundation.framework from mac os sdk 10.11, but at runtime was linked to CoreFoundation.framework from /System/Library/Frameworks/ where version of which is 10.10 (as OS version).
How I fixed this. Friend of mine has xcode 6 yet, I took mac os sdk 10.10 from there (as you remember in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, name is MacOSX10.10.sdk) and added it to Xcode of mine. Then I rebuilt my static library with 10.10 sdk (you could compile from cli with '-sdk macosx10.10' parameter or set build sdk in Build Settings => Base SDK). After the problem has been solved.
I assume that for the iOS you could apply the same strategy.
I experienced the same exact crash running Xcode 7.0 beta 6 on a device with the first iOS 9 beta installed, the crash however was not occurring while using the simulator.
After updating my iPhone to iOS 9 beta 5, the crash stopped.
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/Contents/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.
Iam able to run my project in iPad and iphone but when i tried to run it in iPad simulators
but then i got this error .
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Users/apple/Documents/releaseAPICON2015/SenTestingKit.framework/SenTestingKit' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
please check this link for screenshot
Error
Please tell me how to get back all simulators in xcode 6.1.1
You are trying to link SenTestingKit.framework in you iOS project. You cannot use OS X binaries in iOS Simulator apps as they are not compatible.
On older versions of iOS, you would encounter runtime errors (incorrect values or crashes). On iOS 8.0, this became a link-time error.
You need to build a version of SenTestingKit.framework for iOS. Hope this helps.. :)