iOS打包 遇到的[x86_64, i386]問題解決方案iTunes Store Operation Failed ERROR ITMS-90087: "Unsupported Architectu
阿新 • • 發佈:2018-12-11
專案上架,打包遇到[x86_64, i386]問題,先把問題扔出來
iTunes Store Operation Failed ERROR ITMS-90087: "Unsupported Architectures. The executable for MMMagazineReadList.app/Frameworks/HelpDesk.framework contains unsupported architectures '[x86_64]'." iTunes Store Operation Failed ERROR ITMS-90087: "Unsupported Architectures. The executable for MMMagazineReadList.app/Frameworks/HyphenateLite.framework contains unsupported architectures '[x86_64, i386]'." iTunes Store Operation Failed ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'MMMagazineReadList.app/Frameworks/HelpDesk.framework/HelpDesk' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
方法一:偶爾有用
剛剛開始找到的解決方案是讓我加入一個指令碼,具體如下(具體效果:第一次有效果,之後打包還是會遇到同樣的問題,而且第二次過後就會效果失效,不知道原因,瞭解的大神請告知,謝謝)
在專案-->Build Phases -->Run Script 新增如下shell指令碼,然後再試試打包。
# Without further ado, here’s the script. Add a Run Script step to your build steps, put it after your step to embed frameworks, set it to use /bin/sh and enter the following script: APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" # This script loops through the frameworks embedded in the application and # removes unused architectures. find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK do FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable) FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME" echo "Executable is $FRAMEWORK_EXECUTABLE_PATH" EXTRACTED_ARCHS=() for ARCH in $ARCHS do echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME" lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH" EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH") done echo "Merging extracted architectures: ${ARCHS}" lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}" rm "${EXTRACTED_ARCHS[@]}" echo "Replacing original executable with thinned version" rm "$FRAMEWORK_EXECUTABLE_PATH" mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH" done
方法二:親測有用
由於該問題的產生原因是因為x86_64, i386是模擬器使用的,而打包上傳appStore是不允許的,所以需要移除這個框架
我的專案裡面因為有環信的原因,有HelpDesk.framework和HyphenateLite.framework包含了這個,所以需要到這兩個framework下移除,具體操作如下:
1、開啟終端,進入你的framework的路徑下(cd /Users/MAC/Desktop/MyProject/HyphenateLite.framework) 2、lipo -remove i386 HyphenateLite -o HyphenateLite && lipo -remove x86_64 HyphenateLite -o HyphenateLite 【若有其他庫,在進入,移除一下就好】 3、重新開啟專案,clean一下,Build一下,記住不要跑模擬器,然後打包,上傳成功