dyld: Library not loaded: #rpath/X.framework/X - ios

When I try to run app on real device,I face this issue.I tried these solutions but they don't work
I cleaned derived data and delete the app
I changed frameworks, libraries , embedded content to "embed & sign"
Rechecking if X.XCFramework is in "Link binaries with libraries " at Build Phase or
not.but it was there
Copy framework in copy bundle resources
I changed installation directory to #executable_path/Frameworks in framework build setting
I set Framework search paths and Library search path to physical framework path in host application
The Xcode version is 13.0
dyld: Library not loaded: #rpath/X.framework/X
Referenced from: /var/containers/Bundle/Application/D3E0B89E-B0B2-4511-9B33-84EA9AF51821/Y.app/Y
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/D3E0B89E-B0B2-4511-9B33-84EA9AF51821/Y.app/Frameworks/X.framework/X: missing LC_DYLD_INFO load command

Related

Used dylib in my IOS framework getting error after App lauch

I have an embedded dylib in my IOS framework and trying use this framework in my application after launch is giving me an error.
Error:
dyld: Library not loaded:*.dylib
Referenced from: /private/var/containers/Bundle/Application/43345D9E-F58D-4FBD-9C22-DD2554AE0484/COCO.app/Frameworks/*.framework/cocosdk
Reason: image not found
.dylib is embedded in "Framework" folder in my IOS framework.
things I've tried:
install_name_tool -change oldpath newpath libname
The framework already present in Embedded Binarie
Present in Build Phases Copy Files to Framework
Added Runpath search path as "#rpath/*.dylib", "#executable_path/Frameworks", "#executable_path/Frameworks/*.framework/Frameworks/*.dylib", "#rpath/Frameworks/*.framework/Frameworks/*.dylib"
Added same path in Dynamic Lib install name
Deleted all Derived Data
Clean the project and tried
8.'Build Libraries for Distribution' == true.
Ran into this issue recently, when switching from Fat/Universal binary to creating a XCFramework.
Check in your framework project if 'Build Libraries for Distribution' == true.

A library I no longer use crashes the app on startup. How to remove it completely? Xcode / Swift

I installed a library using cocoapods and decided I no longer need it and deleted. However, when I try to launch the app, it crashes with this error:
dyld: Library not loaded: #rpath/LiquidFloatingActionButton.framework/LiquidFloatingActionButton
Referenced from: /var/containers/Bundle/Application/98CA3428-C3A7-45F3-BA24-E91D51D10503/MyProject.app/MyProject
Reason: image not found
(lldb)
LiquidFloatingActionButton is the name of the framework I deleted. How can I get rid of this?
Go to your Build phases and remove the framework from "Link Binary with Libraries"
then remove any associated file in your project directory
Also, in your Build phases you must have some copy file/ run script / bundle resource phases associated with that cocoapod.. remove that as well
i am not sure how did you remove your framework you should select "REMOVE FROM REFERENCE ".Well you just remove your project from Link Binary with Libraries and also need to clean your drive data then check your framework search path in build setting.
if all theses not works then update your cocoa pod.

How to attach library to ios project?

I'm developing a command line tool app that uses AppList library. But when i trying to run in on my device, the error occured:
dyld: Library not loaded: /usr/lib/libapplist.dylib
Referenced from: /usr/bin/testApp
Reason: image not found
Is it possible to attach libapplist.dylib to project package?
All dylibs have an installation path inside mach-o header. That path is placed in your application import section so that linker could find the dylib. When your process is launched dyld searches that path for the dylib.
You can check that path like this:
otool -D libapplist.dylib
That's what dyld is telling you - it couldn't find the dylib. You have two options:
Place your dylib where it needs to be
Change installation path.
If it's your dylib you can change it inside xcode project settings of your dylib - search for installation directory. When you rebuild dylib and application linking it they will contain the new path.
If you can't recompile the dylib then you need to change it manually. Here is how you can do it:
install_name_tool -id #executable_path/libapplist.dylib libapplist.dylib
#executable_path tells the linker to search for dylib where application executable is located.
Its simple go to build phases and link framework and library
go to build phases in app settings
add the library which you want

Unity 4.6.5 project won't run on iOS simulator

Unity 4.6.5 project won't run on iOS simulator and I'm getting runtime error:
dyld: Symbol not found: _OBJC_CLASS_$_CBAnalytics
Referenced from: /Users/diverseconnection/Library/Developer/CoreSimulator/Devices/983BAC55-2713-423B-B5F3-C135ECCC2768/data/Containers/Bundle/Application/D4CAC0C7-E3D6-48F5-B264-E6EB715F9709/trouble.app/trouble
Expected in: flat namespace
in /Users/diverseconnection/Library/Developer/CoreSimulator/Devices/983BAC55-2713-423B-B5F3-C135ECCC2768/data/Containers/Bundle/Application/D4CAC0C7-E3D6-48F5-B264-E6EB715F9709/trouble.app/trouble
(lldb)
Any ideas how to fix it?
Well this error is usually rather broad as there can be number of causes. You can try these fixes
Add the correct libraries in the Link Binary With Libraries section of the Build Phases.
If you want to add a library outside of the default search path you can include the path in the Library Search Paths value in the Build Settings and add -l{library_name_without_lib_and_suffix} (eg. for libz.a use -lz) to the Other Linker Flags section of Build Settings.
You copy files into your project but forgot to check the target to add the files to. To resolve:
Open the Build Phases for the correct target, expand Compile Sources and add the missing .m files.
You include a static library that is built for another architecture like i386, the simulator on your host machine. To resolve:
If you have multiple library files from your libraries vendor to include in the project you need to include the one for the simulator (i386) and the one for the device (armv7 for example).
Optionally, you could create a fat static library that contains both architectures.
Also try this
Remove Build Active Architecture Only (build setting parameter key is 'ONLY_ACTIVE_ARCH') from all of your static libraries' project build settings or overwrite it with 'NO'

Dylib error 'Library not loaded' distributing application

I'm developing an app in objective-C++ that uses dynamic libraries of OpenCV and VTK but I've a problem on distribution, if I launch my app in a different system I got this issue:
Dyld Error Message:
Library not loaded: #executable_path/../Frameworks/libvtkCommon.5.6.1.dylib
Referenced from: /myApp.app/Contents/MacOS/myApp
Reason: no suitable image found. Did find:
/myApp.app/Contents/MacOS/../Frameworks/libvtkCommon.5.6.1.dylib: open() failed with errno=13
/myApp.app/Contents/MacOS/../Frameworks/libvtkCommon.5.6.1.dylib: open() failed with errno=13
I've rebuilt my dylibs with install_name_tool to point to: #executable_path/../Frameworks and in "build phase" of myApp's target I've added "copy files" phase with destination "Frameworks" for my dylibs. Where is the problem?
Check your application bundle and make sure the file that got copied into Frameworks is the actual dylib and not a symbolic link file. Also, did you run install_name_tool on both the dylib file and your executable? Look at this page under Shared Libraries for an example.
Also see this question.

Resources