日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

在Xcode中從動(dòng)態(tài)庫剝離不需要的架構(gòu)(90008錯(cuò)誤)

 最初九月雪 2018-03-01

在Xcode中從動(dòng)態(tài)庫剝離不需要的架構(gòu)

自從iOS 8發(fā)布以來,開發(fā)人員已經(jīng)能夠利用動(dòng)態(tài)庫對(duì)iOS開發(fā)的好處。對(duì)于一般開發(fā),為所有需要的架構(gòu)設(shè)置一個(gè)單一的動(dòng)態(tài)庫是非常好的,所以您可以在所有設(shè)備和iOS模擬器上運(yùn)行,而無需更改任何東西。然而,這種方法有一個(gè)缺點(diǎn) - 因?yàn)樗鼈冊(cè)谶\(yùn)行時(shí)鏈接,當(dāng)一個(gè)動(dòng)態(tài)庫被單獨(dú)編譯到最終應(yīng)用程序時(shí),不可能知道實(shí)際需要哪些架構(gòu)。因此,Xcode將在編譯時(shí)將整個(gè)事物復(fù)制到應(yīng)用程序包中。除了浪費(fèi)的磁盤空間,理論上沒有真正的缺點(diǎn)。但是實(shí)際上,iTunes Connect不喜歡我們添加未使用的二進(jìn)制切片:這時(shí)候,打包上傳Appstore會(huì)報(bào)如下錯(cuò)誤:

那么,我們?nèi)绾谓鉀Q這個(gè)問題呢?
步驟如下:

在Build Phases中加入run script。在里面添加Shell腳本,

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
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

該腳本將查看您構(gòu)建的應(yīng)用程序的Frameworks文件夾,并確保只有您正在構(gòu)建的架構(gòu)存在于每個(gè)框架中。
好多了!現(xiàn)在我可以在我的項(xiàng)目中添加包含我所需要的所有架構(gòu)的胖動(dòng)態(tài)庫,而我的構(gòu)建過程將會(huì)在任何給定的時(shí)刻處理哪些架構(gòu)。

 

可解決環(huán)信HyphenateLite.framework上傳appstore報(bào)錯(cuò):

在使用環(huán)信HyphenateLite.framework時(shí),出現(xiàn)如下錯(cuò)誤:

Code1:ERROR ITMS-90087: "Unsupported Architectures.

The executable for MM_FESCO.app/Frameworks/HyphenateLite.framework

contains unsupported architectures '[x86_64, i386]'."
ERROR ITMS-90087: "Unsupported Architectures.

The executable for MM_FESCO.app/Frameworks/HyphenateLite.framework

contains unsupported architectures '[x86_64, i386]'."
Code2:ERROR ITMS-90209: "Invalid Segment Alignment.

The app binary at 'MM_FESCO.app/Frameworks/HyphenateLite.framework/HyphenateLite'

does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
ERROR ITMS-90209: "Invalid Segment Alignment.

The app binary at 'MM_FESCO.app/Frameworks/HyphenateLite.framework/HyphenateLite'

does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
Code3:ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
ERROR ITMS-90125: "The binary is invalid.

The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid,

or the binary is already encrypted.

This binary does not seem to have been built with Apple's linker."
Code4:WARNING ITMS-90080: "The executable 'Payload/MM_FESCO.app/Frameworks/HyphenateLite.framework'

is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables.

For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
WARNING ITMS-90080: "The executable 'Payload/MM_FESCO.app/Frameworks/HyphenateLite.framework'

is not a Position Independent Executable.

Please ensure that your build settings are configured to create PIE executables.

For more information refer to Technical Q&A QA1788 -

Building a Position Independent Executable in the iOS Developer Library."

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多