我們創建了一個框架並將其集成到我的一個應用中。我能夠使用此框架運行和調試應用程序,但在提交到應用商店時我收到了以下錯誤。iOS:通用框架在提交到應用商店時造成問題
請注意,我使用的是xcode 6.3。
錯誤:'不支持的體系結構',XYZ的可執行文件包含不受支持的體系結構'[x86_64,i386]'。「
我曾在設置中添加以下腳本框架代碼,同時創建
框架(靜態庫),使它具有普遍性。
**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
誰能幫我創建框架,我可以調試(裝置運行模擬器),運行(在設備),並且還提交的appstore。
預先感謝。
如果我想發佈與其他設備,應用商店和模擬器一樣的通用框架,該怎麼辦? –
通用框架從未與應該提交給AppStore的應用程序捆綁在一起。你可以嘗試在腳本里面使用'lipo -remove arch_type'來準備上傳到AppStore的應用程序以去除模擬器的二進制片(Apple只是不會將帶有冗餘體系結構片的二進制文件傳遞到AppStore) –
那麼框架如何像Parse .framework成功構建它可以在任何地方工作? –