fastlane: Export Failed with Xcode 7 - `No applicable devices found`

Original issue by @natanrolnik - Imported from fastlane/gym#104

Hey Felix! I’m trying to export a lane that in previous Fastlane worked. I’m running fastlane v. 1.29.1 and gym 0.8.1.

I receive the following error:

2015-09-24 00:31:00.811 xcodebuild[52660:811706] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fda446c5d90>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo=0x7fda44b61b80 {NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.

Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo=0x7fda44b61b80 {NSLocalizedDescription=No applicable devices found.}

Archive succeeds, but the export fails. I took a look here https://github.com/fastlane/gym/issues/89 and here https://github.com/fastlane/gym/issues/90 and tried some suggestions there, with no success.

Before updating from 1.28 to 1.29.1, I was having provisioning profile errors, and now this one.

Any ideas of what is causing this?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 43 (1 by maintainers)

Most upvoted comments

@bassrock commented

Ok interesting enough I use Bundler with fast lane. I added CFPropertyList and sqlite3 to my gem file and it instantly started working. My guess is the way fast lane works with bundler may be the issue.

Little update here. Finally i digged into the log dir /var/folders/.../myapp-nightly_2017-01-12_13-47-54.428.xcdistributionlogs which is printed in the above log output. I saw those lines at the end:

            code = 0;
            description = "Failed to verify bitcode in Alamofire.framework/Alamofire:\nerror: Cannot extract bundle from /var/folders/kg/hgs6n2rs0lsdynbwjhtg360c0000gn/T/IDEDistributionThinningStep.eP6/Payload/myapp-nightly.app/Frameworks/Alamofire.framework/Alamofire (i386)\n\n";
            info =             {
            };
            level = ERROR;
            type = "malformed-payload";
        },
                {
            code = 0;
            description = "Failed to verify bitcode in KeychainSwift.framework/KeychainSwift:\nerror: Cannot extract bundle from /var/folders/kg/hgs6n2rs0lsdynbwjhtg360c0000gn/T/IDEDistributionThinningStep.eP6/Payload/myapp-nightly.app/Frameworks/KeychainSwift.framework/KeychainSwift (i386)\n\n";
            info =             {
            };
            level = ERROR;
            type = "malformed-payload";
        },
                {
            code = 0;
            description = "Failed to verify bitcode in Realm.framework/Realm:\nerror: Cannot extract bundle from /var/folders/kg/hgs6n2rs0lsdynbwjhtg360c0000gn/T/IDEDistributionThinningStep.eP6/Payload/myapp-nightly.app/Frameworks/Realm.framework/Realm (i386)\n\n";
            info =             {
            };
            level = ERROR;
            type = "malformed-payload";
        },
                {
            code = 0;
            description = "Failed to verify bitcode in RealmSwift.framework/RealmSwift:\nerror: Cannot extract bundle from /var/folders/kg/hgs6n2rs0lsdynbwjhtg360c0000gn/T/IDEDistributionThinningStep.eP6/Payload/myapp-nightly.app/Frameworks/RealmSwift.framework/RealmSwift (i386)\n\n";
            info =             {
            };
            level = ERROR;
            type = "malformed-payload";
        }
    );
}

That told me it has something to do with bitcode enabled. After I diabled bitcode in my project and changed my gym action to this:

gym({
    scheme: "myapp-nightly",
    include_bitcode: false,
    clean: true
  })

it worked smoothly… So as small hint for the others with the same problem: Try to investigate the detailed problem in the IDEDistribution.standard.log file.

Of course … it would be nice to have bitcode enabled. But I think as long as Apple does not make it mandatory we will always struggle with this … because so much tools and frameworks out there do not support bitcode right. In my specific case I think it’s somehow the combination with carthage, which also still have some bitcode support issues.

@howie-misfit commented

I am using gym 1.1.6(also gym 1.0.0) Tried:

  1. use_legacy_build_api: true, works.
  2. Do not use_legacy_build_api,
    $ gem update $ gem outdated does not work.
  3. Do not use_legacy_build_api,
    $ gem install CFPropertyList does not work.
  4. Do not use_legacy_build_api,
    $ gem install CFPropertyList $ gem install sqlite3 It works !

@KrauseFx after updating fastlane to the latest version and removing legacy_api call i am getting this error ```[14:36:38]: ▸ Signing DerivedData/MyApp/Build/Intermediates/ArchiveIntermediates/MyApp\ Beta/InstallationBuildProductsLocation/Applications/MyApp-Enterprise.app @[14:36:40]: ▸ Touching MyApp-Enterprise.app.dSYM [14:36:42]: ▸ Archive Succeeded [14:36:42]: Generated plist file with the following values: [14:36:42]: ▸ ----------------------------------------- [14:36:42]: ▸ { [14:36:42]: ▸ “method”: “enterprise” [14:36:42]: ▸ } [14:36:42]: ▸ ----------------------------------------- [14:36:42]: $ /usr/bin/xcrun /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-2.4.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist ‘/var/folders/xg/p2flh_xs4hj8wd9wrdmg5v080000gp/T/gym_config20170103-18919-wn7ul6.plist’ -archivePath /Users/romk1n/Library/Developer/Xcode/Archives/2017-01-03/MyApp-Enterprise\ 2017-01-03\ 14.26.57.xcarchive -exportPath ‘/var/folders/xg/p2flh_xs4hj8wd9wrdmg5v080000gp/T/gym_output20170103-18919-1qp1av’ rbenv detected, removing env variables rbenv: no such command `shell’

  • xcodebuild -exportArchive -exportOptionsPlist /var/folders/xg/p2flh_xs4hj8wd9wrdmg5v080000gp/T/gym_config20170103-18919-wn7ul6.plist -archivePath ‘/Users/romk1n/Library/Developer/Xcode/Archives/2017-01-03/MyApp-Enterprise 2017-01-03 14.26.57.xcarchive’ -exportPath /var/folders/xg/p2flh_xs4hj8wd9wrdmg5v080000gp/T/gym_output20170103-18919-1qp1av 2017-01-03 14:36:42.793 xcodebuild[27853:13815313] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path ‘/var/folders/xg/p2flh_xs4hj8wd9wrdmg5v080000gp/T/MyApp-Enterpise_2017-01-03_14-36-42.792.xcdistributionlogs’. 2017-01-03 14:37:08.401 xcodebuild[27853:13815313] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7ff6be3f3e00>: Error Domain=IDEDistributionErrorDomain Code=14 “No applicable devices found.” UserInfo={NSLocalizedDescription=No applicable devices found.} error: exportArchive: No applicable devices found.

Error Domain=IDEDistributionErrorDomain Code=14 “No applicable devices found.” UserInfo={NSLocalizedDescription=No applicable devices found.}```

no idea how to fix it really, i substitute it the real app name for privacy

fastlane version 2.4.0

One more note for @bassrock 's solution: in our case it wasn’t enough to just add the two gem to the Gemfile, and actually it wasn’t even required. The error happened if $GEM_HOME was set to any path (we did call xcodebuild directly from the script, without any additional tool).

We did a couple of additional tests and it seems that (at least in our case) the issue only happens if we have a Gemfile in the directory and $GEM_HOME is set. The exact same xcodebuild -exportArchive .. command works if either there’s no Gemfile in the directory, or if $GEM_HOME is not set.

Just in case someone would find this issue when searching for the error message 😉

Got exactly same error as well. In my case the cause was a framework missing UIDeviceFamilyin Info.plist.

@lemonkey-medhelp commented

@bassrock I added those two gems to my Gemfile and it resolved it for me as well.

@natanrolnik commented

Great, using the use_legacy_build_api: true made it.

Do you know what causes it to fail when not using the legacy? I’ll pay attention in the new releases, to know when to remove it.

@KrauseFx commented
gym(scheme: "MyProj AdHoc", sdk: "iphoneos9.0", use_legacy_build_api: true)