xcode 文件是为 arm64 构建的,这不是被链接的架构 (x86_64)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30118010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
file was built for arm64 which is not the architecture being linked (x86_64)
提问by hunterp
I am building a framework first to use in my ios simulator. However I get this error when importing it into the main project:
我正在构建一个首先在我的 ios 模拟器中使用的框架。但是,将其导入主项目时出现此错误:
file was built for arm64 which is not the architecture being linked (x86_64)
文件是为 arm64 构建的,这不是被链接的架构 (x86_64)
Here is the build info of my framework:
这是我的框架的构建信息:
UPDATE:
更新:
I created a universal framework using this technique: https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46cbut I'm still getting the error
我使用这种技术创建了一个通用框架:https: //medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c但我仍然收到错误
UPDATE:Results from running file on the binary:
更新:在二进制文件上运行文件的结果:
hunterp$ file dinkle
dinkle: Mach-O universal binary with 2 architectures
dinkle (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
dinkle (for architecture arm64): Mach-O 64-bit dynamically linked shared library
采纳答案by hunterp
I was incorrectly copying the binary framework and using an old one from before I changed it into a universal.
在将其更改为通用框架之前,我错误地复制了二进制框架并使用了旧框架。
回答by Vivek Yadav
To create framework and convert .h file into .a fat file. Compile your project with simulator target and device target ,after these two tasks you have to join to make universal file with shell.
创建框架并将 .h 文件转换为 .a fat 文件。使用模拟器目标和设备目标编译您的项目,在这两个任务之后,您必须加入以使用 shell 制作通用文件。