Static library gives error on iOS simulator and works on iOS device
Currently I’m working on a iOS application (iOS 6), In which I need to implement a static library.
I successfully implemented the Static library using this tutorial. And I successfully added the static library to other project and Installed the app to iPhone !. It’s working successfully.
But my issue is when I tried to run it on my simulator some errors are coming:
"_OBJC_CLASS_$_MMPAlert", referenced from: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I added the target architecture like:
I searched a lot but couldn’t find a solution, why my library is working on device and giving error on simulator.
Please help me, thanks in advance
- How can I use an .a static library in swift?
- Static libraries in Xcode 4
- What's the difference between `-fembed-bitcode` and BITCODE_GENERATION_MODE?
- Linking static libraries, that share another static library
- Interface Builder can't see classes in a static library
- Create podspec to ship static library
Solutions Collect From Internet About “Static library gives error on iOS simulator and works on iOS device”
You have propably built your library for the device architecture only. The iOS Simulator is not an emulator, meaning the code needs to be able to run on your Mac’s architecture, which is obviously different from your device’s architecture.
As a library is precompiled (for a specific architecture), the code it consists of doesn’t get compiled again for your current target once you use it in your project. This is why you need to build your library for both architectures in the first place.
This SO Answer explains how to bundle two library builds into one handy “fat file”.
- How to extend Array for generic type?
- NSJSONSerialization for an object with an id attribute
- Status Bar in UITableViewController
- How to extend iOS app to tvOS
- UIPercentDrivenInteractiveTransition doesn't get to animation's completion on fast gesture
- How to rename react-native entry file (index.ios.js)
- UITextField set placeholder color as dark in iOS
- Saving login credentials Xcode
- Self.Type cannot be directly converted to AnyClass in extension to objective-c class in swift
- Parsing Json to get all the contents in one NSArray
- CALayer – Shadow causes a performance hit?
- Firebase Auth using phone number returns an internal error
- scaledValueForValue: called on a font that doesn't have a text style set
- Accessing a variable that is out of scope Swift
- how do I delete an app from the organizer left menu