I’m trying to install the plugin with fastlane 2.19.1 on macOS 10.12.3 with XCode 8.2.1. The installation fails with the following error:
$ fastlane add_plugin instrumented_tests
+---------------------------------------------+---------+-----------------------------+
| Used plugins |
+---------------------------------------------+---------+-----------------------------+
| Plugin | Version | Action |
+---------------------------------------------+---------+-----------------------------+
| fastlane-plugin-automated_test_emulator_run | 1.3.2 | automated_test_emulator_run |
+---------------------------------------------+---------+-----------------------------+
[11:51:10]: Plugin 'fastlane-plugin-instrumented_tests' was added to './fastlane/Pluginfile'
[11:51:10]: Make sure to commit your Gemfile, Gemfile.lock and Pluginfile to version control
Installing plugin dependencies...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
/Users/xxx/.fastlane/bin/bundle/bin/ruby -r ./siteconf20170303-7561-1yddh4i.rb extconf.rb
creating Makefile
current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
In file included from generator.c:1:
In file included from ./../fbuffer/fbuffer.h:5:
In file included from /Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/ruby.h:29:
/Users/xxx/.fastlane/bin/bundle/include/ruby-2.2.0/ruby/defines.h:26:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/json-2.0.3 for inspection.
Results logged to /Users/xxx/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/json-2.0.3/gem_make.out
An error occurred while installing json (2.0.3), and Bundler cannot continue.
Make sure that `gem install json -v '2.0.3'` succeeds before bundling.
I ran gem install json -v '2.0.3'
as admin user and successfully installed the gem. Unfortunately it didn’t fix the problem. I’m still getting the same error.
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.0)
CFPropertyList (2.2.8)
io-console (0.4.2)
json (2.0.3, 1.7.7)
libxml-ruby (2.6.0)
minitest (4.3.2)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.7)
test-unit (2.0.0.0)
✅ fastlane environment ✅
Stack
Key |
Value |
OS |
10.12.3 |
Ruby |
2.2.4 |
Bundler? |
false |
Git |
git version 2.10.1 (Apple Git-78) |
Installation Source |
~/.fastlane/bin/bundle/bin/fastlane |
Host |
Mac OS X 10.12.3 (16D32) |
Ruby Lib Dir |
~/.fastlane/bin/bundle/lib |
OpenSSL Version |
OpenSSL 1.0.2g 1 Mar 2016 |
Is contained |
true |
Is homebrew |
false |
Xcode Path |
/Applications/Xcode821.app/Contents/Developer/ |
Xcode Version |
8.2.1 |
System Locale
Variable |
Value |
|
LANG |
en_US.UTF-8 |
✅ |
LC_ALL |
en_US.UTF-8 |
✅ |
LANGUAGE |
en_US.UTF-8 |
✅ |
fastlane gems
Gem |
Version |
Update-Status |
fastlane |
2.19.1 |
✅ Up-To-Date |
Loaded fastlane plugins:
Plugin |
Version |
Update-Status |
fastlane-plugin-automated_test_emulator_run |
1.3.2 |
✅ Up-To-Date |
fastlane-plugin-instrumented_tests |
0.1.5 |
✅ Up-To-Date |
Loaded gems
Gem |
Version |
CFPropertyList |
2.3.5 |
activesupport |
4.2.7.1 |
addressable |
2.5.0 |
babosa |
1.0.2 |
bigdecimal |
1.2.6 |
bundler |
1.14.3 |
claide |
1.0.1 |
colored |
1.2 |
commander |
4.4.3 |
domain_name |
0.5.20161129 |
dotenv |
2.2.0 |
excon |
0.55.0 |
excon |
0.54.0 |
faraday |
0.11.0 |
faraday-cookie_jar |
0.0.6 |
faraday_middleware |
0.11.0.1 |
fastimage |
2.1.0 |
fastimage |
2.0.1 |
fastlane-plugin-automated_test_emulator_run |
1.3.2 |
fastlane-plugin-instrumented_tests |
0.1.5 |
gh_inspector |
1.0.3 |
google-api-client |
0.9.26 |
googleauth |
0.5.1 |
highline |
1.7.8 |
http-cookie |
1.0.3 |
httpclient |
2.8.3 |
hurley |
0.2 |
i18n |
0.8.1 |
i18n |
0.7.0 |
io-console |
0.4.3 |
json |
1.8.1 |
jwt |
1.5.6 |
libxml-ruby |
2.9.0 |
little-plugger |
1.1.4 |
logging |
2.1.0 |
memoist |
0.15.0 |
mime-types |
3.1 |
mime-types-data |
3.2016.0521 |
mini_magick |
4.5.1 |
minitest |
5.10.1 |
minitest |
5.4.3 |
multi_json |
1.12.1 |
multi_xml |
0.6.0 |
multipart-post |
2.0.0 |
nanaimo |
0.2.3 |
nokogiri |
1.5.6 |
os |
0.9.6 |
plist |
3.2.0 |
power_assert |
0.2.2 |
psych |
2.0.8 |
public_suffix |
2.0.5 |
rake |
10.4.2 |
rdoc |
4.2.0 |
representable |
2.3.0 |
retriable |
2.1.0 |
rouge |
1.11.1 |
rubygems-update |
2.5.2 |
rubyzip |
1.2.1 |
rubyzip |
1.2.0 |
security |
0.1.3 |
signet |
0.7.3 |
slack-notifier |
1.5.1 |
sqlite3 |
1.3.13 |
terminal-notifier |
1.7.1 |
terminal-table |
1.7.3 |
test-unit |
3.0.8 |
thread_safe |
0.3.6 |
thread_safe |
0.3.5 |
tty-screen |
0.5.0 |
tzinfo |
1.2.2 |
uber |
0.0.15 |
unf |
0.1.4 |
unf_ext |
0.0.7.2 |
unicode-display_width |
1.1.3 |
word_wrap |
1.0.0 |
xcodeproj |
1.4.2 |
xcpretty |
0.2.4 |
xcpretty-travis-formatter |
0.0.4 |
generated on: 2017-03-03
Hey @brianlenz could you try running
bundle install
and then tryingbundle exec fastlane add_plugin appicon
one more time?In case anybody else has similar issues, once I did the above, I ran into issues with OpenSSL in some fastlane commands. So, I decided to start over: installed openssl and ruby via Homebrew, reinstalled fastlane via Homebrew, trashed the
~/.fastlane/
directory again, and then ran everything throughbundle
(using the Homebrew Ruby installation instead of macOS Ruby):bundle install
bundle exec fastlane upgrade_plugins
bundle exec fastlane [lane]
Everything is working flawlessly now, no
sudo
required.Thanks again, @ohayon!
Oh, no worries; your help is much appreciated.
I used
sudo
for therm -rf ~/.fastlane
, as apparently some of those files were owned by root, too. Now it works!Thanks again!
Hi Everyone!
If you are getting stuck by this issue, you can work around it by creating a
Gemfile
in your project’s directory and executing fastlane by usingbundle exec fastlane <actions>
. This will ensure that you will always have the plugins necessary for your fastlane execution.We will update this issue as we get more information and have a proposed fix! 🚀
Please continue to let us know if you are still experiencing this issue!
Thanks! 🐙
@hjanuschka I think it is definitely related to the contained version.
The problem should be the following line:
I’m guessing that all the people who have this problem have macOS 10.12? /cc @multiholle @jaydrogers @j2kun
My best guess would be that the sysroot for the ruby installation in the contained version gets set to the above line, which is not valid on 10.12, so it fails when trying to install a plugin with native extensions. <strike> As a workaround, manually creating a link like
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
should probably work. </strike> Nevermind, I just set up a test project and it doesn’t.Just a note… I have this exact same issue but instead of a plugin it’s using the
badge
action (or is that a plugin?).I then try to follow your suggestion of adding a
Gemfile
to the project and usingbundle
but despite adding the file withgem 'badge'
I was getting the following error:I ended up just removing the badge step from my fastfile for now but would be good to get a proper fix to this
Thanks for all of your suggestions on this thread. Since I am running macOS 10.12.3, I attempted the suggestion from @milch and now I am getting new errors:
Output when I attempt
fastlane add_plugin cordova
:Here is my mkmf.log:
Here is the output of
gem install json -v '2.0.3'
:You can see that it doesn’t run into any issue.
Thanks again for all of your help!
the contained version ships with it’s own ruby version and all sort of libraries - but for whatever reason it has problems building gems that require C extensions.
the only workaround i see right now is switching to rvm/rbenv based install - but i do not recommend this, i would wait for @ohayon - maybe there is a easy fix in the contained version.
i already pinged the right members.
This appears not to be fixed in
v2.20.0
Sure thing!
bundle exec fastlane add_plugin appicon
still gives the same error. Should I run that viasudo
, as well?@jaydrogers FWIW, I was trying to install the same plugin and ran into the same issue. It appears to be depending on a library (ruby-static) that is installed as part of the ruby development platform. I was able to download just that library from >here<. (it’s an RPM). Dropped the unpacked libruby-static.a into ~/.fastlane/bin/dependencies/lib and it finally installed correctly. Alternatively, I read another thread >here< that suggested that you could update the ruby install and it would provide the library that way. Good luck.
This plugin better be worth the trouble 😛
I did a bit of googling, but I don’t think there is. (EDIT: specifically, briefly looking at https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb (the file that is used to create the configuration) it seems that
expand_path
is called on paths that are passed in)No, I think just building against 10.12 would only shift the issue from people who have 10.12 installed to people who have 10.11 installed. A better fix would be to use
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
as$SYSROOT
when building, I think that should be the same on both 10.12 and 10.11. I don’t have a machine with 10.11 on it to test that, though.