Skip to content

Creating archive with Xcode 9.1 fails #13070

Closed

Description

@oemera

We are trying to create a IPA file with Xcode 9 commandline tools and are running into issues. If we do the same procedure with Xcode 8.3.3 it works fine so we blieve the problem is tied to Xcode 9.1.

Steps to Reproduce

  1. flutter create -i swift --org com.example.xcode_error .
  2. Open Xcode and set Signing to Automatically manage signing
  3. Set device toGeneric iOS Device
  4. Choose Product -> Archive
  5. After successfully archiving choose app in Organizer
  6. Export... the app as Enterprise deployment

After a couple seconds you will see this error:

ipatool failed with an exception: #<TypeError: no implicit conversion of nil into Array>
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2769:in `&'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2769:in `bestDeviceTraitsForBundle'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1210:in `block in makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1195:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1195:in `makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2466:in `block in ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2444:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2444:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2940:in `<main>'

Logs

Xcode ipatool logs:
IDEDistribution.verbose.log

Flutter Doctor

[✓] Flutter (on Mac OS X 10.12.6 16G29, locale en-DE, channel master)
    • Flutter at /Users/oemeravci/Documents/Development/XcodeWorkspace/Grandcentrix/sample_flutter/flutter
    • Framework revision d5d2cdfeef (12 hours ago), 2017-11-16 22:53:22 -0800
    • Engine revision 25912b8482
    • Tools Dart version 1.25.0-dev.11.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.1, Build version 9B55
    • ios-deploy 1.9.2
    • CocoaPods version 1.2.1

[✓] Android Studio (version 2.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b05)

[-] IntelliJ IDEA Community Edition (version 2017.2.4)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[✓] Connected devices
    • None

Activity

  1. cbracken commented on Jan 10, 2018

    @cbracken
    Member
  2. cbracken commented on Jan 10, 2018

    @cbracken
    Member

    Interesting, this looks potentially like a bug in ipatool, which is a Ruby script that's part of Xcode. Out of curiosity, does Xcode 9.2 resolve this issue for you?

    I'll give a go at reproducing this today.

  3. passsy commented on Jan 10, 2018

    @passsy
    Contributor

    I'm not able to export an app as Enterprise deployment. Tested with Xcode 9.2 and flutter on master 77872cc and alpha 8f65fec.

    New: Xcode tells me to first build the app in release mode.

    ========================================================================
    ERROR: Flutter archive builds must be run in Release mode.
    
    To correct, run:
    flutter build ios --release
    
    then re-run Archive from Xcode.
    ========================================================================
    

    After doing so I get the same error:

    ipatool failed with an exception: #<TypeError: no implicit conversion of nil into Array>
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `&'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `bestDeviceTraitsForBundle'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1209:in `block in makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `each'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2464:in `block in ProcessIPA'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `each'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `ProcessIPA'
        /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2938:in `<main>'
    

    screen shot 2018-01-10 at 19 51 26

    The "Development" and "Ad Hoc" distributions fail as well with the same error message

    [✓] Flutter (on Mac OS X 10.13.2 17C88, locale en-DE, channel master)
        • Flutter at /Users/pascalwelsch/Projects/flutter
        • Framework revision 77872cc560 (28 minutes ago), 2018-01-10 10:27:59 -0800
        • Engine revision 5a72197b73
        • Tools Dart version 1.25.0-dev.11.0
        • Engine Dart version 2.0.0-edge.bd6cbd1ec7e79730ea1fd8ba01139f4e18a02290
    
    [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
        • Android SDK at /usr/local/share/android-sdk
        • Android NDK at /usr/local/share/android-sdk/ndk-bundle
        • Platform android-27, build-tools 27.0.3
        • ANDROID_HOME = /usr/local/share/android-sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 9.2, Build version 9C40b
        • ios-deploy 1.9.2
        • CocoaPods version 1.3.1
    
    [✓] Android Studio
        • Android Studio at /Applications/Android Studio 3.1 Preview.app/Contents
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1012-b01)
    
    [✓] Android Studio (version 3.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    
    [✓] IntelliJ IDEA Community Edition (version 2017.3.2)
        • Flutter plugin version 20.0.3
        • Dart plugin version 173.4127.31
    
    [✓] Connected devices
        • iPhone X • E8880D2A-08D0-47D8-8E09-AD3A1C8B527A • ios • iOS 11.2 (simulator)
    
  4. pedia commented on Jan 12, 2018

    @pedia

    Me too. XCode behavior
    I changed:
    ...
    5.
    6. Validate...
    7. Next
    8. then Export

    Succeeded.

  5. oemera commented on Jan 12, 2018

    @oemera
    Author

    @pedia thank you for pointing out that it works with Validate -> Export. This works for me too (I used my personal Apple Developer Account to test this).

    Unfortunately this workaround doesn't work with our Enterprise Developer Account because Validate does validate the app with iTunes Connect and Enterprise Developer Accounts don't have access to iTunes Connect.

  6. kamal333k commented on Feb 15, 2018

    @kamal333k

    Hi guys, I'm facing this similar issue while creating an ipa.
    I tried to export after validating but on validating it asks me for app store provisioning profile.

    I'm not trying to publish my application on app store. I want to create an ipa in adhoc environment.
    Can anyone help me on this?

  7. ben-wood commented on Feb 24, 2018

    @ben-wood

    This error must have something to do with App Thinning, If I click next quickly before the error comes up while it is checking for App Thinning then it goes right on with the export.

  8. pedia commented on Feb 27, 2018

    @pedia

    I prefer fastlane to finish the work of XCode, like:
    adhoc, enterprise, upload to testflight, publish to appstore...

  9. xster commented on Feb 27, 2018

    @xster
    Member

    Haven't tried to reproduce this yet but in the meantime, wrt fastlane, here's an example of our Gallery app being built, signed and pushed to iTunes Connect programmatically
    https://github.com/flutter/flutter/blob/master/dev/bots/travis_script.sh#L21

    Here's the actual Fastfile https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/ios/fastlane/Fastfile though the whole thing could be a lot simpler if building locally instead of an untrusted CI system.

  10. sw-tt-jigneshkumarchitaliya commented on Mar 7, 2018

    @sw-tt-jigneshkumarchitaliya

    Please change validate build product release Yes to No. For more detail please check the screenshot.
    runner

  11. fralways commented on Mar 28, 2018

    @fralways

    Still happening with the export option in xcode organizer - tho I get this error for Ad-Hoc option (didn't try enterprise). Clicking fast on Next button is a workaround and I was able to successfully distribute generated ipa.
    (Changing validate build product release from Yes to No doesn't help)

  12. alescdb commented on Mar 30, 2018

    @alescdb

    I was having this issue too with XCode 9.2.
    I've update to 9.3 this morning and it's resolved !

  13. 3 remaining items

  14. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    c: crashStack traces logged to the console
    on Dec 10, 2018
  15. added this to the milestone on Dec 10, 2018
  16. zoechi commented on Dec 11, 2018

    @zoechi
    Contributor

    Related to #12774

  17. added
    t: xcode"xcodebuild" on iOS and general Xcode project management
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 5, 2019
  18. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 8, 2019
  19. Chetan8488 commented on Mar 14, 2019

    @Chetan8488

    Not's working Xcode 9.2
    Please update Xcode 10.1
    Then working fine...

  20. jmagman commented on Aug 16, 2019

    @jmagman
    Member

    Looks like this ipatool bug was resolved with Xcode 9.3, which was released more than a year ago. Closing.

  21. github-actions commented on Aug 16, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  22. locked as resolved and limited conversation to collaborators on Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleplatform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions