错误ITMS-90171:“无效的捆绑包结构不允许二进制文件MyApp.app/libswiftRemoteMirror.dylib

时间:2019-01-15 06:36:32

标签: ios jenkins ipa

尝试上载基于Jenkins的ipa时出现错误消息。

  

错误ITMS-90171:“无效的捆绑包结构-不允许二进制文件'ideaPitch.app/libswiftRemoteMirror.dylib'。您的应用程序除支持包的CFBundleExecutable之外,不能包含独立的可执行文件或库。请参阅https://developer.apple.com/go/?id=bundle-structure的《捆绑编程指南》,了解有关iOS应用捆绑结构的信息。”

我如何在詹金斯上获得ipa

   /usr/bin/xcodebuild -list -workspace My_App.xcworkspace
   /usr/bin/xcodebuild -scheme My_App -workspace My_App.xcworkspace -configuration Release clean build CONFIGURATION_BUILD_DIR=${WORKSPACE}/build -UseModernBuildSystem=0
   /usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/build/My_App.app" -o ${WORKSPACE}/build/My_App${PRODUCT_VERSION}-${PRODUCT_VERSION}.ipa

   ditto -c -k --keepParent -rsrc "${WORKSPACE}/build/My_App.app.dSYM" ${WORKSPACE}/build/My_App-${PRODUCT_VERSION}-${PRODUCT_VERSION}-dSYM.zip

当我在Xcode上获取ipa时,一切正常。但是,我需要在詹金斯身上做。什么会导致此问题?谢谢。

编辑我搜索了SO,并找到了一些帖子(如下面的帖子)。但是,我需要找出此问题的代码行或代码,因此我不能直接复制并粘贴答案。因此,请勿将其标记为重复。

ERROR ITMS-90171: "Invalid Bundle Structure The binary file APP.app/libswiftRemoteMirror.dylib is not permitted

1 个答案:

答案 0 :(得分:0)

问题在于获取构建,然后从It获取iPA。当我搜索时,正确的路径是归档项目,然后使用xcodebuild从存档中获取iPA。

正确的两行代码是;

 /usr/bin/xcodebuild -quiet -workspace ${workspaceName} -scheme ${schemeName} -sdk iphoneos -configuration Release archive -archivePath ${WORKSPACE}/build/${appName}.xcarchive
 /usr/bin/xcodebuild -exportArchive -archivePath ${WORKSPACE}/build/${appName}.xcarchive -exportOptionsPlist My_Project_Main_Folder/Resources/${environment}/${environment}_ExportOptions.plist -exportPath ${WORKSPACE}/build

P.S::PackageApplication和Xcodebuild之间有区别。 Xcodebuild需要一个导出选项plist文件,该文件告诉Xcodebuild,它使用什么选项,例如证书,配置文件和位码支持等。

示例导出选项Plist文件:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <false/>
    <key>destination</key>
    <string>export</string>
    <key>method</key>
    <string>development</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.iamdeveloper.myapp.dev</key>
        <string>My App Development Provision</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Developer</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>XXXXXXXXXX</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>