Xcode 6.1 error while building IPA

前端 未结 7 631
再見小時候
再見小時候 2020-11-29 15:53

Just upgraded to Xcode 6.1 today, and guess what: Now I\'m having trouble submitting builds using the TestFlight desktop app. Here\'s the error I\'m getting while the app st

相关标签:
7条回答
  • 2020-11-29 16:16

    On Yosemite w/ XCode 6.4 even using the SDKROOT patch the codesigning fails. The following article explains how to patch the XCode script to get around this. Note that this is patching XCode, so it is version specific, but fixes the problem.

    http://www.jayway.com/2015/05/21/fixing-your-ios-build-scripts

    0 讨论(0)
  • 2020-11-29 16:25

    The answer from Alistra work for me but I doesn't want to change a script which is not mine (a future Xcode release might change this file and the correction will be lost).

     diff PackageApplication PackageApplicationFixed 155,157c155,156
    <-     my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
    <-                          "--sign", $opt{sign},
    <-                          "--resource-rules=$destApp/ResourceRules.plist");
    ---
    ->     my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
    ->                          "--sign", $opt{sign});
    

    I think answer from Vladimir Grigorov is the best if you have an archive using :

    xcodebuild -exportArchive -archivePath [path to archive] -exportPath [path to output directory] -exportOptionsPlist [path to options.plist file]
    

    In my case, I doesn't have the archive, because I modify the application after build it and I need to change the Bundle Id and signing certificate.

    The solution I found is to call codesign myself before used PackageApplication and ask PackageApplication to not sign. Like this :

    replace :
    
     /usr/bin/xcrun -sdk iphoneos PackageApplication -v "<app_path>" -o "<ipa_path>" --sign "<provisioning_profile.certificateSubject>" --embed "<provisioning_profile.path>"
    
    by :
    
    /bin/cp -rpfv "<provisioning_profile.path>" "<app_path>/embedded.mobileprovision"
    /usr/bin/codesign -v -vvvv -f -s "<provisioning_profile.certificateSubject>" --entitlements="<entitlement_path>" "<app_path>"
    /usr/bin/xcrun -sdk iphoneos PackageApplication -v "<app_path>" -o "<ipa_path>"
    

    Don't forget to embedded the .mobileprovision file using to sign with cp.

    0 讨论(0)
  • 2020-11-29 16:26

    I wish I knew why it works, but here's a fix that worked for me:

    Found the fix !

    Click on your project > Targets > Select your target > Build Settings >

    Code Signing Resource Rules Path

    and add :

    $(SDKROOT)/ResourceRules.plist

    0 讨论(0)
  • 2020-11-29 16:30

    I emailed TestFlight support and got this response:

    Our team is currently investigating this issue with the TestFlight Desktop app. In the meantime, please use Xcode to create the IPA file and then upload it using the desktop app or the TestFlight website.

    The suggested workaround did work.

    0 讨论(0)
  • 2020-11-29 16:30

    The answer by Tim Gostony no longer works since the release of Xcode 7. Now the App Store submission process fails when resource rules are present. The solution is to clear your Code Signing Resource Rules Path and replace xcrun with xcodebuild tool:

    xcodebuild -exportArchive -archivePath [path to archive] -exportPath [path to output directory] -exportOptionsPlist [path to options.plist file]
    

    The simplest Options.plist for exporting ad-hoc distribution ipa files looks like this:

    <?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>iCloudContainerEnvironment</key>
        <string>Production</string>
        <key>teamID</key>
        <string>[YOUR TEAM ID]</string>
        <key>method</key>
        <string>ad-hoc</string>
    </dict>
    </plist>
    

    There are other options available for this plist file regarding bitcode, app thinning, etc. That's why I think xcodebuild tool is the right tool for exporting ipa files for iOS 9 and above.

    More details about options plist are available with xcodebuild -help command.

    0 讨论(0)
  • 2020-11-29 16:36

    The following patch for PackageApplications fixed it for me, I removed resource-rules as it says it's deprecated on 10.10.

    Testflight builds work without it. Appstore builds too.

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
     % diff PackageApplication PackageApplicationFixed 
    155,157c155,156
    <     my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
    <                          "--sign", $opt{sign},
    <                          "--resource-rules=$destApp/ResourceRules.plist");
    ---
    >     my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
    >                          "--sign", $opt{sign});
    
    0 讨论(0)
提交回复
热议问题