Just installed Xcode 10, and got tis run time error. Do you have any idea what is wrong?
dyld: Library not loaded: /usr/lib/libstdc++.6.dylib
Referenced from: /Users/kukodajanos/Library/Developer/CoreSimulator/Devices/50603E30-571E-484B-BABD-270D3D1F01AE/data/Containers/Bundle/Application/AFA530AF-2F31-4B26-ACE0-776070E28368/PFB.app/Frameworks/FoxitRDK.framework/FoxitRDK
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
(lldb)
Previous Xcode app worked in simulator.
lipo -info /Users/kukodajanos/Workspace/PFB/FoxitRDK.framework/FoxitRDK
Architectures in the fat file: /Users/kukodajanos/Workspace/PFB/FoxitRDK.framework/FoxitRDK are: i386 x86_64 armv7 arm64
As you see Foxit lipo shows it has also the i386 x86_64 architecture as well. So it should work on simulator.
Does this article mean we need to update Foxit to 5.0.0.1107?
This is a bug of Foxit PDF SDK V6.0 on iOS 12 and Foxit already fixed in V6.1. Please double check the version you are useing.
The background of this issue is that: Xcode 10 has removed "libstdc++.6.dylib",
a temporary solution base on V6.0 is to copy libstdc++.6.dylib from Xcode 9.x to Xcode10.
For Foxit PDF SDK V6.1 the SDK itself isn't reference libstdc++.6.dylib and reference libc++ instead (which is Apple recommend)
Related
We are using MFP 7.0 on our mobile app development. On Xcode 9, we don't have any issue and all our apps are running smoothly.
When Xcode 10 and iOS 12 came out, we upgraded our MacBooks but we are having issues during compilation. We've added the library libstdc++.6.dylib as recommended from forums. It is working fine when we run on Simulator but if we try to test in real devices (iPhone/iPad), we are getting error message "../native/Frameworks/libstdc++.6.dylib, missing required architecture arm64".
Here's the actual warning/error log in my xcode when i run the app targeting my iphone device:
ld: warning: ignoring file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib, missing required architecture arm64 in file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib (2 slices)
Undefined symbols for architecture arm64:
"std::basic_ostringstream, std::allocator >::basic_ostringstream(std::_Ios_Openmode)", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
"std::ostream::operator<<(double)", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
"std::string::c_str() const", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
"std::basic_string, std::allocator >::~basic_string()", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
"std::basic_ostringstream, std::allocator >::str() const", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
"std::basic_ostringstream, std::allocator >::~basic_ostringstream()", referenced from:
+[NSNumber(UCUtils) doubleToString:] in libWorklightStaticLibProject.a(NSNumber-UCUtils.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
:-1: ignoring file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib, missing required architecture arm64 in file /Users/jm/Documents/App/native/Frameworks/libstdc++.6.dylib (2 slices)
:-1: symbol(s) not found for architecture arm64
:-1: linker command failed with exit code 1 (use -v to see invocation)
I tried following on MFP v6.2 which worked fine on device. You can try the same. Can you give more details from your question from where you were copying the stdlibc++ libraries.
From your Xcode 9 machine
copy the file: (libstdc++.6.0.9.tbd) and (libstdc++.6.tbd)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
Paste to following path on Xcode 10 machine
copy the file: (libstdc++.6.0.9.tbd) and (libstdc++.6.tbd) to :
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
and
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
(Please note the distinction "iPhoneOS" and "iPhoneSimulator")
Add the copied library (libstdc++.6.0.9.tbd) and (libstdc++.6.tbd) to “Build Phase-> Link libraries” Path of Xcode project.
clean xcode and rebuild it.
Execute on iOS 12 device
Note :For Simulator issues with /usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator, can try copy the original file: libstdc++.6.0.9.dylib and libstdc++.6.dylib and libstdc++.dylib to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
But sometime even doing does not work, recommeneded to run on iOS 11 simulator
You mentioned "We've added the library libstdc++.6.dylib as recommended from forums." , It seems the library libstdc++.6.dylib you copied from previous Xcode version is not built for arm64 but just for simulator architecture.
The best way is to get rid of libstdc++ library by replacing it with libc++ in linked libraries in build phase for Xcode project.This works well with MobileFirst version v7.1 and v8.0.
Undefined symbols for architecture x86_64:
"_BROADCAST_MODE_IBEACON", referenced from:
-[MainViewController tableView:cellForRowAtIndexPath:] in MainViewController.o
"_OBJC_CLASS_$_TZBeaconSDK", referenced from:
objc-class-ref in MainViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I take that error when I want to use simulator. There is no problem when I build it on iPhone. There is only problem when I use simulator. I have tried to change Architectures from Build settings, error text changes as i386 but problem is same.
I use that sdk; TZBeacon
Is there any problem with sdk? Could you help me to solve that problem?
Your library does not support simulator. Run this command line to see which architecture that it supports:
lipo -info libTZBeaconSDK.a
the result is: Architectures in the fat file: libTZBeaconSDK.a are: armv7 arm64
So, you have to test in a device, not in simulator!
Typically you get that error in the simulator if the architecture of the framework is built for the device. You need to use a version of the framework that is built for the simulator to run it on the simulator. This is something that should be provided by the framework vendor.
If they don't provide one then look into only including that framework when building to the device and not to the simulator. There is another SO answer here to point you in the right direction: How to only include a framework when building for device, not iOS Simulator?
Simple trick here: Go -> Go To Folder "/Library/Developer/Xcode"
delete Derived data next clean your project then Run .
I am trying to include MumbleKit as a library instead of having to compile it each time by following the suggestion of a member of this forum. Yet when I try to compile on the simulator I get:
missing required architecture x86_64 in …libMumbleKit.a (3 slices)
I think I added all the necessary versions to MumbleKit before generating the library:
arm64 armv7 armv7s armv7k arm7s x86_64 i386
notwithstanding, when I execute:
lipo -info libMumbleKit.a
I get:
Architectures in the fat file: libMumbleKit.a are: armv7 armv7s arm64
as well as configuring Build Active Architecture to NO.
I generated the library for MumbleKit both using the Generic iOS device and a iOS 9 physical device.
When I try to archive using the Generic iOS Device option after having extracted the Mumble library in the same way, I instead get error:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
armv7
Same when using my physical device after also generating the library in the correspondent way:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
And finally the installation on my iOS 9 iPhone 6S went fine with just the same contents in the warning:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
CryptState.cpp if a c++ file in the library.
Check architectures it has with lipo tool. Open terminal, navigate to folder where your library is and do:
lipo -info yourlib.a
If you don't have x86_64, than you should find/compile lib that will have it.
x86_64 is an architecture for Simulator, not for generic iOS device.
I applied the suggestion at:
Xcode 7 'CrashReporter does not contain bitcode' linker error
by adding option -fembed-bitcode to the other linker flags field. And now the problem has moved to a c file: band.c, notwithstanding of course I have added this option for the c and c++ files.
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(bands.o)' was built
without full bitcode. All object files and libraries for bitcode must
be generated from Xcode Archive or Install build for architecture
arm64
What might be still missing?
I aborted the attempt. There must be something faulty in the original mumble kit project not allowing to import its library into another project, or I do not know how to do it anyway.
I am having an issue adding the MagTek library and header. After they are added (I followed all the information I could find) I get this error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MTSCRA", referenced from:
objc-class-ref in CONAppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have wasted so much time figuring this out. I am using Xcode 5. Any Help would be appreciated.
The MagTek library must not 64-bit and you are trying to run against the iPhone 64-bit simulator and/or on the iPhone 5s. In your "Build Settings," under "Architectures," try changing to $(ARCHS_STANDARD_32_BIT) or $(ARCHS_STANDARD) to not build the 64-bit version as a workaround.
It worked for me with following changes ( In your "Build Settings," under "Architectures"),
Removed arm64 from the list of 'Valid Architectures'
'Build Active Architecture Only' set to 'No'
Set architectures to 'Standard Architectures'
From iOS 11 onwards all apps should be in 64-bit, so you can get the latest iOS MagTek library at..
https://www.magtek.com/support/idynamo?tab=software
I use cocoapods and download Aviary SDK from the website and follow all the instructions from website. However, I still get an error below:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_AFPhotoEditorController", referenced from:
Any idea how to fix it? Is the libAviarySDK.a compiled for 64bit architecture?
It appears that the library does not have an arm64 compiled binary. You should change your build settings to only build for armv7 and armv7s if you want to continue using this SDK.
If your app requires arm64 support, then you won't be able to use this SDK until its authors provide an arm64 compiled version.
AviarySDK 4.2.1 now supports arm64 architecture.
# lipo -info AviarySDK.framework/AviarySDK
Architectures in the fat file: AviarySDK.framework/AviarySDK are: i386 armv7 armv7s arm64
aviary 3.3.7 is compatible with iOS7. So i suggest you can try to change Architectures of your project to "Standard architectures (armv7, armv7s)"