JotUI
JotUI copied to clipboard
Error building on an iPhone 6: missing required architecture arm64
I have got the code working on the iPhone simulator, but when building for my iPhone it gives the following error:
ld: warning: ignoring file /.../JotUI.framework/JotUI, missing required architecture arm64 in file /.../JotUI.framework/JotUI (2 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_JotBrushTexture", referenced from:
objc-class-ref in Pen.o
"_OBJC_CLASS_$_JotDefaultBrushTexture", referenced from:
objc-class-ref in Pen.o
"_OBJC_CLASS_$_JotView", referenced from:
objc-class-ref in SigningViewController.o
"_OBJC_CLASS_$_JotBufferManager", referenced from:
objc-class-ref in SigningViewController.o
"_OBJC_CLASS_$_JotViewStateProxy", referenced from:
objc-class-ref in MyViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm guessing the framework needs to be built for arm64 but I'm not sure how to do that? Does that require the code to be updated in the framework or can I fix this by doing something else? Thanks!
I think this might be to do with where I'm getting the build framework from. After I've built the project where should I be accessing the framework from?
Are you building the framework and then copying it into your main project? If so, make sure you have iOS Device selected as the build target in Xcode:
Then I believe you can Product => Archive and use that. Or you can simply use the debug build version that Xcode will put in the Products directory.
Ok so Product => Archive seems to create an xcarchive, but no framework? Using the debug build version works but then I can't build for simulator. I need to make a universal framework so I can test on simulator and device.
According to https://gkbrown.org/2017/10/11/creating-a-universal-framework-in-xcode-9/, the only way to build a single framework that contains both simulator and device versions is to build the project twice and combine them with a script.
I usually have an Xcode workspace that contains my main app's project and also the JotUI project, and then add the JotUI to the main project's linked frameworks. Then Xcode will re-build JotUI depending on the target I needed.