iOS打包 遇到的[x86_64, i386]問題解決方案iTunes Store Operation Failed ERROR ITMS-90087 && ERROR ITMS-90535
阿新 • • 發佈:2018-12-19
ERROR ITMS-90087
專案上架,打包遇到[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一下,記住不要跑模擬器,然後打包,上傳成功
ERROR ITMS-90535
報錯資訊如下
ERROR ITMS-90535:"Unexpected CFBundleExecutable Key. The bundle at ‘XXX.app/EaseUIResource.bundle’ does not contain a bundle executable.
If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL.
If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.”
報錯資訊詳細已經指出XXX.app/EaseUIResource.bundle中存在一個不可執行的欄位,需要將此欄位移除,即從報錯可以看出是CFBundlePackageType欄位需要刪除;
我的專案是因為集成了環信人工互動雲SDK,其中的HelpDeskUIResources.bundle中的info.plist檔案移除了Executable file為key,HelpDeskResource為value的配置,問題解決!