I have an iOS app and I want to test it on simulator. When I run the project xcode complains that my framework file is "missing required architecture i386 in file".
I did a bit of search on line and it says that's because xcode used the framework files intended for actual device when building the project for simulator. Solution is to add the simulator framework folder under the framework search path in build settings.
Okay now the problem is, doing that solves the problem of building project on simulator, but later when I want to build the project on an actual device, xcode starts complaining again saying there are redefinitions of some of the openGL typedef in the framework. To fix this I have to remove the search path item that I added.
So is there an easy way to avoid having this kind of problem? I don't want to switch the search path over and over again when I want to build the project on different platform.
If you upgrade a project from 4.2 to 4.3.2 style it often loses the architectures required for the target you are building for. Usually you just have to add them back or change the target SDK.
Related
Kotlin iOS Integration:
KMP is creating a separate shared.framework based on architecture (Simulator/iPhone). Both the frameworks are generated under the Debug directory. As the frameworks search path is set recursive it searches for incorrect framework and throws error and my iOS apps compiling fails.
I am not able to find out which framework to link depending on selected platform Device/Simulator.
Just wanted to know if there is any possible way to handle this issue of multiple frameworks so I can switch between Simulator or Device and the Xcode matches and applies the correct shared.framework
I needed to add /$(CONFIGURATION)/$(SDK_NAME)and make it as non-recursive.
Now even if I run app on simulator and then on actual device, Xcode maps & links correct shared.framework.
This solved my issue.
This issue is driving me nuts. I am asking it here before I announce it as a bug in XCode and try to use another version of XCode.
So, I am using XCode 8.3.2. I have a project that generates a static library. I am moving the .a file to another project and I use it (I know I can integrate the static library project in the second project but I don't want that here).
The file generated is 4.4MB. After copying the newly created .a and I copy it to the second project and test it, everything works fine. But when I come back to the library project and build it, the generated file is 2.3MB with missing symbols!!!
I cannot make it work unless I restart my MAC, or XCode somehow crashes.
What I have tried : Clean project, clean folder, delete Derived data, added -all_load -force_load -ObjC flags in my target linker flags.
If anyone has any idea about what is happening, please inform me.
Thanks!
It depends upon the target device you have selected during building your library. In Xcode, When you select any specific simulator or device, that time Xcode only creates single slice or thin product.
If you select Generic iOS device , means no device or simulator, that time Xcode create library having all the device slices and one folder having Simulator slice.
By using LIPO command you can put simulator and device slices together.
In your case, during first and second time, You are changing the device target from Generic iOS Device to specific device.
I have an Xcode Cocoa Touch Framework project (written in
Objective-C) that produces a .framework directory as well as the
corresponding .dSYM file. Its using iOS 10.1 as its Base SDK
with a deployment target of 8.0. All built using Xcode 8.1.
I would like to profile my framework using Instruments so I've added
my framework into a separate Xcode project (written in Swift). It
builds and runs fine. However in Instruments, the symbols from my
framework are not showing.
In the Instruments menu: File -> Symbols, it shows that there are
Missing symbols but they are all from System Frameworks
(/usr/lib/dyld)
When I try to set the dSYM path to the dSYM file of my framework, it says that:
No new libraries to symbolicate. The specified path didn't locate a dSYM for any of the selected libraries.
Am I profiling my framework the wrong way? Or am I missing other settings in my framework's build settings?
Any help is appreciated. Thanks!
The problem went away once I profiled the app in an actual device instead of the simulator.
I am experimenting with pulling data from the internet for my app, and everything works as it should when the app is run in the iOS Simulator or on my own device.
The frameworks I'm using are Alamofire, SwiftyJSON and GzipSwift; I cloned the Github repo of the Gzip framework, build it myself, dragged the .framework into my project navigator and linked it up (added the framework to Link Binary with Libraries under Build Phases).
Now, when I build the code for any specific device, it compiles and runs just fine, but when I select 'Generic iOS Device' as the target, the build process fails and tells me that it couldn't find the methods I used from the Gzip framework.
I am quite certain I missed some setting or didn't import the framework correctly, but I have no clue on how to fix this.
Any ideas?
I guess you build the framework only with the simulator architecture instead of building it for all architectures (arm64).
I have a Xcode project, that includes a Static Library project, that uses another static library that does not support the iOS simulator architecture (Vuforia SDK: libQCAR.a).
Vuforia SDK documentation states:
Vuforia applications must be deployed to a device to run; they cannot be run in the iOS simulator.
This is my project structure:
MyApp.xcodeproj
Classes
MyStaticLibrary.xcodeproj
Classes that depends on libQCAR.a
Frameworks
libMyStaticLibrary.a
libQCAR.a
My problem is that MyApp.xcodeproj does not build for the iOS Simulator because libQCAR.a is not built for the i386 architecture.
Is there anyway to make MyApp.xcodeproj ignore the libQCAR.a library when building for i386? I would be able to disable all the code that depends on the library with #if !(TARGET_IPHONE_SIMULATOR)
You can use a conditional build settings to specify the library you want to link only on a given platform, instead of adding the library to your project in the usual ways. Specifically, you will need to specify:
-lQCAR
in "Other Linker Flags".
Have a look at the attached image that should make things more clear (in the picture I am linking only for the simulator, you will want to select a device, I guess).
Also, do not forget to add the path to the directory containing the library to "Library Search Path" build setting (this does not need to be conditional; it would not do any harm on the simulator).
This issue seems very similar to: Xcode: Conditional Build Settings based on architecture (Device (ARM) vs Simulator (i386))
I believe sergio's solution is very close, but have you tried specifying the full path to the library under Other Linker Flags (potentially without "-l" - just the path)?
In my case, it should specify clearly which SDK uses which flags.
So in Any iOS Simulator SDK, you should not include the library.
In Any iOS SDK, you should include it. In my case, it's -lCloudReco.