在fat文件上构建iOS框架缺少架构armv7s和x86_64

在fat文件上构建iOS框架缺少架构armv7s和x86_64,第1张

概述我正在按照网站上的指南构建我自己的框架 Create a framework for iOS – RayWenderlich 它运行良好,但是当我在测试项目中集成框架时,它会将错误视为“架构arm64的未定义符号”.当我通过命令检查支持的体系结构时 <myframework>.framework xcrun lipo -info <myframework> 它错过了2个架构armv7s和x86_6 我正在按照网站上的指南构建我自己的框架

Create a framework for iOS – RayWenderlich

它运行良好,但是当我在测试项目中集成框架时,它会将错误视为“架构arm64的未定义符号”.当我通过命令检查支持的体系结构时

<myframework>.framework xcrun lipo -info <myframework>

它错过了2个架构armv7s和x86_64

这是我在Aggregate目标上的运行脚本

set -e# If we're already insIDe this script then dIEif [ -n "$RW_MulTIPLATFORM_BUILD_IN_PROGRESS" ]; thenexit 0fiexport RW_MulTIPLATFORM_BUILD_IN_PROGRESS=1RW_FRAMEWORK_name=${PROJECT_name}RW_input_STATIC_liB="lib${PROJECT_name}.a"RW_FRAMEWORK_LOCATION="${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_name}.framework"function build_static_library {    # Will rebuild the static library as specifIEd    #     build_static_library sdk    xcrun xcodebuild -project "${PROJECT_file_PATH}" \    -target "${TARGET_name}" \    -configuration "${CONfigURATION}" \    -sdk "" \    ONLY_ACTIVE_ARCH=NO \    BUILD_DIR="${BUILD_DIR}" \    OBJROOT="${OBJROOT}" \    BUILD_ROOT="${BUILD_ROOT}" \    SYMROOT="${SYMROOT}" $ACTION}function make_fat_library {    # Will smash 2 static libs together    #     make_fat_library in1 in2 out    xcrun lipo -create "" "" -output ""}# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK nameif [[ "$SDK_name" =~ ([A-Za-z]+) ]]; thenRW_SDK_PLATFORM=${BASH_REMATCH[1]}elseecho "Could not find platform name from SDK_name: $SDK_name"exit 1fi# 2 - Extract the version from the SDKif [[ "$SDK_name" =~ ([0-9]+.*$) ]]; thenRW_SDK_VERSION=${BASH_REMATCH[1]}elseecho "Could not find sdk version from SDK_name: $SDK_name"exit 1fi# 3 - Determine the other platformif [ "$RW_SDK_PLATFORM" == "iphoneos" ]; thenRW_OTHER_PLATFORM=iphonesimulatorelseRW_OTHER_PLATFORM=iphoneosfi# 4 - Find the build directoryif [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$RW_SDK_PLATFORM$]]; thenRW_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}"elseecho "Could not find other platform build directory."exit 1fi# Build the other platform.build_static_library "${RW_OTHER_PLATFORM}${RW_SDK_VERSION}"# If we're currently building for iphonesimulator,then need to rebuild#   to ensure that we get both i386 and x86_64if [ "$RW_SDK_PLATFORM" == "iphonesimulator" ]; thenbuild_static_library "${SDK_name}"fi# Join the 2 static libs into 1 and push into the .frameworkmake_fat_library "${BUILT_PRODUCTS_DIR}/${RW_input_STATIC_liB}" \"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_input_STATIC_liB}" \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_name}"# Ensure that the framework is present in both platform's build directorIEscp -a "${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_name}" \"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_name}.framework/Versions/A/${RW_FRAMEWORK_name}"# copy the framework to the user's desktopditto "${RW_FRAMEWORK_LOCATION}" "${HOME}/Desktop/${RW_FRAMEWORK_name}.framework"

我认为在构建框架时,将框架集成到测试项目时的构建错误是由缺少的体系结构造成的

解决方法 解决了,在我的情况下:在主要目标(RWUIControls,如果你参考Ray W. post)我手动添加了armv7s架构.

见下面的截图:

如果我从终端运行命令:

xcrun lipo -info RWUIControls

在框架文件夹中,我得到:

Architectures in the fat file: RWUIControls are: armv7 armv7s i386 x86_64 arm64
总结

以上是内存溢出为你收集整理的在fat文件上构建iOS框架缺少架构armv7s和x86_64全部内容,希望文章能够帮你解决在fat文件上构建iOS框架缺少架构armv7s和x86_64所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1058113.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存