简体   繁体   English

iOS:通用框架在提交到应用商店时会产生问题

[英]iOS : Universal framework is creating issue while submitting to app store

We have created one framework and integrated it in my one app. 我们创建了一个框架并将其集成到我的应用程序中。 I am able to run and debug the app using this framework but i am receiving below error while submitting to the app store. 我能够使用此框架运行和调试应用程序,但我在提交到应用程序商店时收到以下错误。

Please note that i am using xcode 6.3. 请注意我使用的是xcode 6.3。

Error: 'Unsupported architecture', The executable for XYZ contains unsupported architecture '[x86_64, i386]'. 错误:'不支持的体系结构',XYZ的可执行文件包含不受支持的体系结构'[x86_64,i386]'。 "

I have added below script in settings to Framework code while creating the 我在创建的时候在框架代码的设置中添加了以下脚本
framework(Static library) to make it universal. 框架(静态库)使其具有通用性。

 **Options**


REVEAL_ARCHIVE_IN_FINDER=true

FRAMEWORK_NAME="${PROJECT_NAME}"

SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"

DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework"



UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"

FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"


`Build Frameworks`

  xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator -target ${PROJECT_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator | echo

 xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphoneos -target ${PROJECT_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos | echo

 #xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" | echo

#xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" | echo



 Create directory for universal


rm -rf "${UNIVERSAL_LIBRARY_DIR}"

mkdir "${UNIVERSAL_LIBRARY_DIR}"

mkdir "${FRAMEWORK}"



Copy files Framework


cp -r "${DEVICE_LIBRARY_PATH}/." "${FRAMEWORK}"



Make fat universal binary


lipo "${SIMULATOR_LIBRARY_PATH}/${FRAMEWORK_NAME}"     "${DEVICE_LIBRARY_PATH}/${FRAMEWORK_NAME}" -create -output     "${FRAMEWORK}/${FRAMEWORK_NAME}" | echo



 On Release, copy the result to desktop folder


if [ "${CONFIGURATION}" == "Release" ]; then
mkdir "${HOME}/Desktop/${FRAMEWORK_NAME}-${CONFIGURATION}-iphoneuniversal/"
cp -r "${FRAMEWORK}" "${HOME}/Desktop/${FRAMEWORK_NAME}-${CONFIGURATION}-    iphoneuniversal/"
fi



 If needed, open the Framework folder


if [ ${REVEAL_ARCHIVE_IN_FINDER} = true ]; then
if [ "${CONFIGURATION}" == "Release" ]; then
open "${HOME}/Desktop/${FRAMEWORK_NAME}-${CONFIGURATION}-iphoneuniversal/"
else
open "${UNIVERSAL_LIBRARY_DIR}/"
fi
fi

Can anyone please help me to create framework which i can debug (means run in simulator), run(in device) and also submit to the appstore. 任何人都可以帮我创建框架,我可以调试(在模拟器中运行),运行(在设备中),并提交到appstore。

Thanks in advance. 提前致谢。

You can't use universal fat binaries with application uploaded to AppStore. 您不能将通用fat二进制文件与上传到AppStore的应用程序一起使用。 If you want to upload with your framework, build it only for device. 如果要使用框架上载,请仅为设备构建它。

You can still use your universal framework, but would have to strip unwanted architecture. 您仍然可以使用通用框架,但必须删除不需要的架构。 i don't try i yet but, i found here a sample of the same problem with solution on striping unwanted architecures. 我还没试过,但是,我在这里找到了一个解决方案,解决了不需要的架构问题。 here 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM