Reputation: 9246
Anybody know about the error “mach-o, but wrong architecture” ? I have built a custom framework(which includes a few other SDK's inside it) & trying to integrate in the client project. I can use/access the custom framework’s methods in the client’s app when I am running in a simulator, but the app is getting crashed while running on the device . Any suggestions will be really helpful. Thanks
Here is the log:-
dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking Referenced from: /private/var/containers/Bundle/Application/644C95E8-6CFD-48BB-861E-7BCECB08FE43/abc_client.app/Frameworks/XYZ_iOS.framework/XYZ_iOS Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/644C95E8-6CFD-48BB-861E-7BCECB08FE43/abc_client.app/Frameworks/XYZ_iOS.framework/Frameworks/AFNetworking.framework/AFNetworking: mach-o, but wrong architecture /private/var/containers/Bundle/Application/644C95E8-6CFD-48BB-861E-7BCECB08FE43/abc_client.app/Frameworks/XYZ_iOS.framework/Frameworks/AFNetworking.framework/AFNetworking: mach-o, but wrong architecture
Upvotes: 1
Views: 653
Reputation: 9925
When building for the Cocoa platform, Elements allows you to choose to build for different CPU Architectures, depending on the target devices and operating system versions you wish to support. Elements allows the creation of so-called "Universal Binaries", or "Fat Binaries", that can include executable code for more than one platform (for example 32-bit and 64-bit). source
The error means that there are architectures which are missing in your framework.
List an architectures in a framework:
There are two terminal tools:
file /path/to/MyFramework.framework/MyFramework source
Example output:
path/to//MyFramework.framework/MyFramework: Mach-O universal binary with 5 architectures
path/to//MyFramework.framework/MyFramework (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
path/to//MyFramework.framework/MyFramework (for architecture i386): Mach-O dynamically linked shared library i386
path/to//MyFramework.framework/MyFramework (for architecture armv7): Mach-O dynamically linked shared library arm
path/to//MyFramework.framework/MyFramework (for architecture armv7s): Mach-O dynamically linked shared library arm
path/to//MyFramework.framework/MyFramework (for architecture arm64): Mach-O 64-bit dynamically linked shared library
lipo -info /usr/lib/libiodbc.a source
arm64
or
armv7
architecturex86_64
architectureSolution
Upvotes: 1