Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

gym within fastlane / archiving fails with "Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found."" #168

Closed
lacostej opened this issue Dec 23, 2015 · 2 comments
Labels

Comments

@lacostej
Copy link
Contributor

See sentry # ee30c12be2e681b3b068b6865fb862cc

I noticed that exportArchive fails when gym is ran from fastlane, but not when ran standalone on my machine:

Realated to http://stackoverflow.com/questions/33041109/xcodebuild-no-applicable-devices-found-when-exporting-archive

gym standalone

DEVELOPER_DIR=/Applications/Xcode-7.2.app gym \
      --project target/UnityLab_ios/Unity-iPhone.xcodeproj \
      --archive_path target/UnityLab_ios/build/Unity-iPhone.xcarchive \
      -o target/UnityLab_ios/build/Unity-iPhone.build/ \
      --include_symbols true

=>

[20:24:01]: > ▸ Archive Succeeded
[20:24:01]: Successfully stored the archive. You can find it in the Xcode Organizer.
[20:24:01]: $ /usr/bin/xcrun xcodebuild -exportArchive -exportOptionsPlist '/tmp/gym_config_1450898641.plist' -archivePath 'target/UnityLab_ios/build/Unity-iPhone.xcarchive' -exportPath '/tmp/1450898641' 
[20:24:19]: Compressing 1 dSYM(s)
[20:24:19]: $ cd '/Users/lacostej/Code/WWTK/unitylab/target/UnityLab_ios/build/Unity-iPhone.xcarchive/dSYMs' && zip -r '/Users/lacostej/Code/WWTK/unitylab/target/UnityLab_ios/build/Unity-iPhone.build/UnityLab.app.dSYM.zip' *.dSYM
[20:24:22]: > updating: UnityLab.app.dSYM/ (stored 0%)
[20:24:22]: > updating: UnityLab.app.dSYM/Contents/ (stored 0%)
[20:24:22]: > updating: UnityLab.app.dSYM/Contents/Info.plist (deflated 52%)
[20:24:22]: > updating: UnityLab.app.dSYM/Contents/Resources/ (stored 0%)
[20:24:22]: > updating: UnityLab.app.dSYM/Contents/Resources/DWARF/ (stored 0%)
[20:24:22]: > updating: UnityLab.app.dSYM/Contents/Resources/DWARF/UnityLab (deflated 73%)

[20:24:22]: Successfully exported and compressed dSYM file
[20:24:22]: Successfully exported and signed the ipa file:
[20:24:22]: /Users/lacostej/Code/WWTK/unitylab/target/UnityLab_ios/build/Unity-iPhone.build/UnityLab.ipa

gym within fastlane

DEVELOPER_DIR=/Applications/Xcode-7.2.app fastlane dev

with Fastfil

  desc "Dev build"
  lane :dev do
    # during dev
    match(type: "development", readonly: true)
    gym(
      project: 'target/UnityLab_ios/Unity-iPhone.xcodeproj',
      sdk: "iphoneos9.2",
      archive_path: 'target/UnityLab_ios/build/Unity-iPhone.xcarchive',
      output_directory: 'target/UnityLab_ios/build/Unity-iPhone.build/',
      include_symbols: true
    )
  end

exportArchive fails

[19:04:31]: > ▸ Archive Succeeded
[19:04:31]: Successfully stored the archive. You can find it in the Xcode Organizer.
[19:04:31]: $ /usr/bin/xcrun xcodebuild -exportArchive -exportOptionsPlist '/tmp/gym_config_1450893871.plist' -archivePath 'target/UnityLab_ios/build/Unity-iPhone.xcarchive' -exportPath '/tmp/1450893871' 
2015-12-23 19:04:32.065 xcodebuild[32889:641052] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-12-23 19:04:32.274 xcodebuild[32889:641052] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zh/pbp2qp89321_0v_hq8fp_qv40000gn/T/Unity-iPhone_2015-12-23_19-04-32.273.xcdistributionlogs'.
2015-12-23 19:04:33.042 xcodebuild[32889:641052] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fe42ed05890>: 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.}

** EXPORT FAILED **
[19:04:33]: Exit status: 70

[!] Error packaging up the application

running the command directly also fails using my own ruby also fails

lacostej@Jeromes-MacBook-Pro ~/Code/WWTK/unitylab (fastlane) rvm use 2.2.4
Using /Users/lacostej/.rvm/gems/ruby-2.2.4
lacostej@Jeromes-MacBook-Pro ~/Code/WWTK/unitylab (fastlane) xcodebuild -exportArchive -exportOptionsPlist /tmp/gym_config_1450894378.plist -archivePath target/UnityLab_ios/build/Unity-iPhone.xcarchive -exportPath /tmp/1450894378
2015-12-23 20:06:27.937 xcodebuild[35351:665258] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-12-23 20:06:28.136 xcodebuild[35351:665258] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zh/pbp2qp89321_0v_hq8fp_qv40000gn/T/Unity-iPhone_2015-12-23_20-06-28.135.xcdistributionlogs'.
2015-12-23 20:06:28.793 xcodebuild[35351:665258] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fd76e134230>: 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.}

** EXPORT FAILED **

forcing the command to run manually within the system ruby works

lacostej@Jeromes-MacBook-Pro ~/Code/WWTK/unitylab (fastlane) rvm use system
Now using system ruby.
lacostej@Jeromes-MacBook-Pro ~/Code/WWTK/unitylab (fastlane) xcodebuild -exportArchive -exportOptionsPlist /tmp/gym_config_1450894378.plist -archivePath target/UnityLab_ios/build/Unity-iPhone.xcarchive -exportPath /tmp/1450894378
2015-12-23 20:06:13.363 xcodebuild[35123:664947] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-12-23 20:06:13.564 xcodebuild[35123:664947] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zh/pbp2qp89321_0v_hq8fp_qv40000gn/T/Unity-iPhone_2015-12-23_20-06-13.562.xcdistributionlogs'.
Exported Unity-iPhone.xcarchive to: /tmp/1450894378
** EXPORT SUCCEEDED **

Running with xcbuild-safe wrapper works also works on the command line

lacostej@Jeromes-MacBook-Pro ~/Code/WWTK/unitylab (fastlane) xcbuild-safe.sh -exportArchive -exportOptionsPlist /tmp/gym_config_1450894378.plist -archivePath target/UnityLab_ios/build/Unity-iPhone.xcarchive -exportPath /tmp/1450894378
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /Users/lacostej/Code/WWTK/unitylab/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

Warning! PATH is not properly set up, '/Users/lacostej/.rvm/gems/ruby-2.2.4/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.2.4'.
Now using system ruby.
+ xcodebuild -exportArchive -exportOptionsPlist /tmp/gym_config_1450894378.plist -archivePath target/UnityLab_ios/build/Unity-iPhone.xcarchive -exportPath /tmp/1450894378
2015-12-23 20:06:58.671 xcodebuild[35606:665722] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-12-23 20:06:58.857 xcodebuild[35606:665722] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zh/pbp2qp89321_0v_hq8fp_qv40000gn/T/Unity-iPhone_2015-12-23_20-06-58.856.xcdistributionlogs'.
Exported Unity-iPhone.xcarchive to: /tmp/1450894378
** EXPORT SUCCEEDED **

modifying gym to use xcduild-safe.sh for export FAILS ?!

diff --git a/lib/gym/generators/package_command_generator_xcode7.rb b/lib/gym/generators/package_command_generator_xcode7.rb
index 0529221..1f13519 100644
--- a/lib/gym/generators/package_command_generator_xcode7.rb
+++ b/lib/gym/generators/package_command_generator_xcode7.rb
@@ -10,7 +10,7 @@ module Gym
       def generate
         print_legacy_information unless Helper.fastlane_enabled?

-        parts = ["/usr/bin/xcrun xcodebuild -exportArchive"]
+        parts = ["/usr/bin/xcrun '/tmp/xcbuild-safe.sh' -exportArchive"]
         parts += options
         parts += pipe
[19:12:58]: > ▸ Archive Succeeded
[19:12:58]: Successfully stored the archive. You can find it in the Xcode Organizer.
[19:12:58]: $ /usr/bin/xcrun '/tmp/xcbuild-safe.sh' -exportArchive -exportOptionsPlist '/tmp/gym_config_1450894378.plist' -archivePath 'target/UnityLab_ios/build/Unity-iPhone.xcarchive' -exportPath '/tmp/1450894378' 
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /Users/lacostej/Code/WWTK/unitylab/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

/Users/lacostej/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/definition.rb:402:in `validate_ruby!': Your Ruby version is 2.0.0, but your Gemfile specified 2.2.4 (Bundler::RubyVersionMismatch)
from /Users/lacostej/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler.rb:88:in `setup'
from /Users/lacostej/.rvm/gems/ruby-2.2.4/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Warning! PATH is not properly set up, '/Users/lacostej/.rvm/gems/ruby-2.2.4/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.2.4'.
Now using system ruby.
+ xcodebuild -exportArchive -exportOptionsPlist /tmp/gym_config_1450894378.plist -archivePath target/UnityLab_ios/build/Unity-iPhone.xcarchive -exportPath /tmp/1450894378
2015-12-23 19:12:59.507 xcodebuild[34820:647527] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-12-23 19:12:59.720 xcodebuild[34820:647527] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/zh/pbp2qp89321_0v_hq8fp_qv40000gn/T/Unity-iPhone_2015-12-23_19-12-59.719.xcdistributionlogs'.
2015-12-23 19:13:00.453 xcodebuild[34820:647527] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7ff8f4236b30>: 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.}

** EXPORT FAILED **
[19:13:00]: Exit status: 70

[!] Error packaging up the application

Any idea what to try next ?

@lacostej
Copy link
Contributor Author

#dupe #90

See conversation there.

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#3150. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants