Hi i followed below procedure for generating libdb-cxx-6.1.a library.
https://ankitthakur.wordpress.com/2011/01/16/build-scripts-for-berkely-db-static-libraries-with-ios-development/
But after importing libdb-cxx-6.1.a and include files in xcode 5.1 i am seeing below exception
dyld: Library not loaded: /Users/rajaramesh/build7forios/lib/libdb_cxx-6.1.dylib
Reason: image not found
I changed mac o type to static library then i am choose a destination with a supported architecture in order to run on this device. I done build for armv7 only not i386 and armv7s architecture. I am implemeting ios application using cordova. Did i miss any thing. Please advise me.
Any advise would be appreciated.
Above problem resolved using following steps.
1) Build architecture for i386 architecture.
2) make realclean
3) Build architecture for armv7, architecture.
4) Got two lib_cxx-6.1.dylib for i386 and armv7.
5) Using lipo create command generated universal build.
6) imported in to xcode framework.
Thanks.
Related
I upgrade my xcode recently.
When I build my iOS frameworks towards My Mac, most of them works fine. However one framework build failed. The error as follow:
My Mac doesn’t support any of XXX.framework’s architectures. You can add My Mac’s x86_64h architecture to XXX.framework’s Architectures build setting.
I have tried add x86_64h, x86_64, and arm64e to valid architecture, but it doesn't work.
I also tried to compare build settings between these frameworks, but failed to find out an solution.
Any suggestion to solve this problem?
I had the same issue, then I changed Valid Architectures to arm64 x86_64.
After this, I was able to build the framework and use it.
I'm working with bluetooth in an old project which was written in swift3 and i'm working on converting it in swift4 and I had this error
"Could not find module 'CzsBleSdk' for architecture 'x86_64'; found: arm64, arm"
I seems that your framework was built and published the binary for the real device - armv7, armv7s, arm64 and you try to run a build for a simulator - x86_64.
Usually when a publisher wants to share a library he should create a Universal aka Fat binary using lipo[About] command.
If it is open source project you can import the project and Xcode will solve this issue
If it is closed source you can try to find it on Cocoapods or ask the publisher to upgrade the framework
You are now using 64 bit architecture in your Swift 4 project. You'll need the latest CzsBleSdk SDK which supports 64-bit architecture. You can integrate that manually or using Pod. I personally recommend Pod.
Having an issue building for iOS. Getting "linking for arm (arm64) failed with Undefined symbols for architecture arm64: "____libinfoptr_mergZXing", referenced from: -u command line option
Any ideas what might be wrong? Let me know if you need additional details
When you get linking errors with iOS externals it means it either hasn't been compiled for the SDK or architecture you are building against. In this case it's telling you it hasn't been compiled against arm64. The good news it that there are universal binary builds (armv7 arm64) available for download from mergExt.com for up to iOS 8.2. iOS 8.3 builds will be coming ASAP.
I have created a custom Objective-C framework. I would like to import it into any given iOS project and use its provided functionality on both the iOS Simulator and an actual device. To import the framework, I link it using the Build Phases > Link Binary With Libraries setting in the app's target. I'm then able to import it into one of my classes with this statement:
#import <CustomFramework/CustomFramework.h>
I can instantiate my framework's classes just fine, but when I try to run my project on a device, I get the following error message:
dyld: Library not loaded: #rpath/CustomFramework.framework/CustomFramework
Referenced from: /var/mobile/Applications/A61E882D-481A-4C0B-B4FD-69F5D24968BF/TestApp.app/TestApp
Reason: image not found
And if I try to run it on the simulator, I get a different error message:
ld: warning: ignoring file /Users/user/Desktop/CustomFramework.framework/CustomFramework, missing required architecture i386 in file /Users/user/Desktop/CustomFramework.framework/CustomFramework (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CustomFramework", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This occurs when I instantiate a class from the framework. If I import the framework but don't actually use it, my app builds successfully. It just errors whenever I instantiate a class from the framework for some reason.
To get the app to build on a device, I followed this SO answer. Instead of linking the framework, I added a new Copy Files phase in the target's Build Phases setting, set the Destination to Framework, and added my framework.
That works great; however, I'd like to test my app on the iOS Simulator as well. When I try to run my app on the simulator, I still get the "missing required architecture i386" error. I've tried the solutions proposed at just about every related SO topic I could find, and nothing has helped me resolve this issue.
Please note that I am trying to use my custom framework in a new Xcode project, so none of the app/build settings have been changed from their defaults.
How can I fix this error so that I can run my app on both the iOS Simulator and a device with my framework included in the project? Any insight would be greatly appreciated!
The issue was that the framework was not compiled for the iOS Simulator's architecture, which is i386. Xcode only compiles a framework for the target architecture, so if I built the framework for the iOS Simulator, it wouldn't work on a device, and if I built the framework for a device, it wouldn't work on the iOS Simulator.
I created my framework from scratch with help from this tutorial: http://www.raywenderlich.com/65964/create-a-framework-for-ios
The multi-architecture build script is what allowed my framework to run on both the iOS Simulator and a device.
I encountered this same problem with Xcode 7.1 when trying to build for the simulator.
Someone else said it worked for them under Xcode 8.2.1, so I tried building/running there and it worked. I didn't have to change targets or anything in my project.
So try upgrading your Xcode if you can, you will presumably get additional bug fixes as well.
So I've had some headaches today trying to solve this one. I have SQLCipher integrated into an iOS application and before I go further, here are my architecture build settings:
As I understand it, this should only build for an armv7s device (such as a iPhone 5), and when trying to run on a armv7 device I quite rightly get this error:
So I try changing the project's build architecture to Standard (armv7s, armv7) and build. This still runs as expected on the armv7s device, but on a armv7 device I get these linking errors:
So naturally I check out the build settings for the library throwing these errors, and they both have armv7 and armv7s in the valid architecture setting, so does anyone know why am I getting those build errors on the armv7 device? I am missing something?
Here are the build settings for the libraries I'm using (openssl-xcode and sqlcipher):
To fix this read the comments above from Stephen and then I did a project clean and rebuilt it.