Debug an obscure error on iPhone - iphone

My app crashes on versions 4.2 and 4.3 of iOS. The line of code that crashes is in a C++ library:
Ais8_001_22_Circle const *circle = dynamic_cast<Ais8_001_22_Circle const*>(*sa);
The console says:
dyld: lazy symbol binding failed: can't resolve symbol ___dynamic_cast MY_APP
because dependent dylib #2 could not be loaded
dyld: can't resolve symbol ___dynamic_cast in MY_APP
because dependent dylib #2 could not be loaded
It would probably help if I could figure out what "dylib #2" is.

It turns out I needed to include the lstdc++ linker flag under iOS 4.X

One possibility - Is the C++ library you are linking to a dynamic library (dylib)? If so, you'll need find a statically linked version for iOS as iOS does not allow dynamic libraries.

Related

Failed to install a project to a real device

Someone who solved this problem by emulating on an iPhone.
It is a project that a library was embedded and well I already gave it a lot of laps and all the Build Setting configurations, from the signature of the build functions are correctly I do not understand what may be happening I have xcode 12.0.1 I will thank you very much for a feetback,
este es mi error:
dyld: Symbol not found: _$s8DropDownAAC9DirectionO6bottomyA2DmFWC
Referenced from: /private/var/containers/Bundle/Application/0E7CFCF6-F3E3-422F-8EF9-BD721F6D0ADB/proyectodemo.app/Frameworks/FrameworkDemo.framework/FrameworkDemo
Expected in: /private/var/containers/Bundle/Application/0E7CFCF6-F3E3-422F-8EF9-BD721F6D0ADB/proyectodemo.app/Frameworks/DropDown.framework/DropDown
in /private/var/containers/Bundle/Application/0E7CFCF6-F3E3-422F-8EF9-BD721F6D0ADB/proyectodemo.app/Frameworks/FrameworkDemo.framework/FrameworkDemo
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)

Swift Package Manager - How to `Always Embed Swift Standard Libraries`?

We have CLI tool written in Swift for common usage (Android and iOS developers) on macOS.
Android developers without Xcode installation get the following error:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: ~/git/myClITool/macosBin Reason: image not found
Abort trap: 6
We found that enabling Always Embed Swift Standard Libraries in Xcode would most likely help, but this CLI tool is exported with SPM, ignoring all Xcode settings.
How can I achieve this build behaviour using SPM only?
Found the following commandline argument: --static-swift-stdlib
Example usage:
swift build --static-swift-stdlib -c release
This would have produced the output we were looking for. Unfortunately since Swift 5, this argument no longer works for any platforms.
When used, SPM throws the following warning:
warning: Swift compiler no longer supports statically linking the
Swift libraries. They're included in the OS by default starting with
macOS Mojave 10.14.4 beta 3. For macOS Mojave 10.14.3 and earlier,
there's an optional Swift library package that can be downloaded from
"More Downloads" for Apple Developers at
https://developer.apple.com/download/more/
Related Swift bugticket: https://bugs.swift.org/browse/SR-648

__dyld_dyld_fatal_error upon app startup

I get a __dyld_dyld_fatal_error when trying to run my app on an iOS3 device:
dyld: Symbol not found: _OBJC_CLASS_$_NSBlockOperation Referenced from: /var/mobile/Application/.......
Expected in: /System/Library/Frameworks/Foundation.framework/Foundation
My guess is that this is due to the fact that blocks aren't supported in iOS3. However, I'm having trouble tracking down which library is referencing NSBlockOperation. Is there a tool similar to dependency walker, that I can use to figure out which module it is?
You need to set your deployment target to iOS 3.x.

problem while installing app on iphone

H everyone
i have up graded my xcode to xcode 4 & i am trying to install a app through this xcode on to a iphone but i am getting following error & i am unable to launch the app
warning: Unable to read symbols for /var/mobile/Applications/7A08B9EA-DD46-47B4-8E0C-BF081BDB1F4B/QIA All.app/QIA All (file not found).
dyld: Library not loaded: /System/Library/Frameworks/QuickLook.framework/QuickLook
Referenced from: /var/mobile/Applications/7A08B9EA-DD46-47B4-8E0C-BF081BDB1F4B/QIA All.app/QIA All
Reason: image not found
i have following warning in my app
ld: warning: directory not found for option '-F/Developer/new xcode/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/System/Library/PrivateFrameworks'
is from this warning
how can i fix this?,,,thanx in advance
you have to check that all images and framework are included friend. may b any image is missing that is deleted from project folder .check if you get any image in red then add that image
Looks like your app is still trying to link to the 3.1.2 SDK. You need to change the SDK in the project settings to Base SDK: Latest (iOS 4.3). Also make sure to clear out any settings in the target for this value so that it inherits it properly.

Printing in 4.2 SDK - would like to support 4.0 without app crashing

I'm trying to have printing in my application.
While this works, and I can indeed print from my application, I would like to be able to run my application on devices that aren't running iOS 4.2.
Even if I check the version before I run the code.
The method that prints the document has all of the classes that are being used to print.
Whenever I switch the simulator back to 4.1, I get a Symbol not found exception that displays the error:
dyld: Symbol not found: _OBJC_CLASS_$_UIMarkupTextPrintFormatter
Referenced from: /Users/Jack/Library/Application Support/iPhone Simulator/4.1/Applications/794534DB-DB53-42E7-A294-7E78FDD3899B/Documentation.app/Documentation
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit
in /Users/Jack/Library/Application Support/iPhone Simulator/4.1/Applications/794534DB-DB53-42E7-A294-7E78FDD3899B/Documentation.app/Documentation
I don't want to discard the users who haven't upgraded to 4.2.
Any help appreciated.
Which compiler are you using? If you haven't, you should switch to LLVM GCC or LLVM to support automatic weak linking as described by Marco Arment in Supporting older versions of iOS while using new APIs.