pink-room / fastlane-plugin-run_tests_firebase_testlab

Runs Android tests in Firebase Test Lab 🚀
MIT License
48 stars 10 forks source link

Error loading plugin 'fastlane-plugin-run_tests_firebase_testlab': #10

Closed shubham0390 closed 6 years ago

shubham0390 commented 6 years ago

Following error occurs when installing the plugin -- Error loading plugin 'fastlane-plugin-run_tests_firebase_testlab': /Users/subhamtyagi/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-plugin-run_tests_firebase_testlab-0.2.0/lib/fastlane/plugin/run_tests_firebase_testlab/actions/run_tests_firebase_testlab_action.rb:187: syntax error, unexpected '.' url = line.scan(/\[(.*)\]/).last&.first ^

bffcorreia commented 6 years ago

Hi @shubham0390,

That's probably because of the Safe Navigation Operator (&.). It's only available after Ruby version 2.3.0. If you have a previous version it won't work.

Cheers

yassinelhadidy commented 6 years ago

Hi @bffcorreia the error still exist however the $ ruby --version ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux-gnu]

bffcorreia commented 6 years ago

Hi again @yassinelhadidy,

First of all sorry for my late response.

Not sure what could be, but it's probably some wrong configuration with your ruby / bundle / rubygems. Because your ruby version is the 2.4.4 but the path to your gems is in /gems/2.2.0/.

Can you try to update your rubygem version: gem update --system. And also the bundle version: gem install bundler.

If you are using rbenv or rvm to manage ruby versions make sure you are using the correct version.

If the error still persists please copy the output of the gem env command to here.

Cheers

soulcramer commented 6 years ago

Hi, I have the same issue when I try to add the plugin. Here's the output of gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.7.7
  - RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-darwin17]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.5.0
  - USER INSTALLATION DIRECTORY: /Users/scott/.gem/ruby/2.5.0
  - RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /Users/scott/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.5.1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-17
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.5.0
     - /Users/scott/.gem/ruby/2.5.0
     - /usr/local/Cellar/ruby/2.5.1/lib/ruby/gems/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/scott/go/bin
     - /Users/scott/.fastlane/bin
     - /Users/scott/bin
     - /usr/local/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/go/bin
     - /usr/local/share/dotnet
     - /opt/X11/bin
     - ~/.dotnet/tools
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands
bffcorreia commented 6 years ago

Hi @soulcramer,

Can you also print the output error and the output of the ruby --version command?

Everything looks fine in your gem env. Maybe fastlane is picking a different version of Ruby?

Nevertheless, I will try to reproduce the error locally to understand what's going on.

soulcramer commented 6 years ago

Hi again @bffcorreia,

❯ ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

I've also run fastlane env (with its output here) and it does look like that Fastlane using a different version of Ruby.

bffcorreia commented 6 years ago

So, the problem is that Fastlane is picking up other Ruby version that is lower than the 2.3.0. Check this question in the fastlane github and let me know if you were able to fix it :)

soulcramer commented 6 years ago

Hi @bffcorreia, So, by installing and using rbenv and then installing Fastlane through gem install fastlane --verbose, Fastlane use the correct version of ruby.

🚫 fastlane environment 🚫 ### Stack | Key | Value | | --------------------------- | ------------------------------------------- | | OS | 10.13.5 | | Ruby | 2.5.1 | | Bundler? | false | | Git | git version 2.17.1 | | Installation Source | ~/.rbenv/versions/2.5.1/bin/fastlane | | Host | Mac OS X 10.13.5 (17F77) | | Ruby Lib Dir | ~/.rbenv/versions/2.5.1/lib | | OpenSSL Version | OpenSSL 1.0.2p 14 Aug 2018 | | Is contained | false | | Is homebrew | false | | Is installed via Fabric.app | false | | Xcode Path | /Applications/Xcode.app/Contents/Developer/ | | Xcode Version | 9.4.1 | ### System Locale | Error | | --------------------------- | | No Locale with UTF8 found 🚫 | ### fastlane files:
`./fastlane/Fastfile` ```ruby # This file contains the fastlane.tools configuration # You can find the documentation at https://docs.fastlane.tools # # For a list of all available actions, check out # # https://docs.fastlane.tools/actions # # For a list of all available plugins, check out # # https://docs.fastlane.tools/plugins/available-plugins # # Uncomment the line if you want fastlane to automatically update itself # update_fastlane default_platform(:android) platform :android do desc "Runs all the tests" lane :test do gradle(task: "test") end desc "Submit a new Beta Build to Crashlytics Beta" lane :beta do gradle(task: "clean assembleRelease") crashlytics # sh "your_script.sh" # You can also use other beta testing services here end desc "Deploy a new version to the Google Play" lane :deploy do gradle(task: "clean assembleRelease") upload_to_play_store end desc "Run instrumentation tests" lane :instrumentation_tests do automated_test_emulator_run( AVD_setup_path: "fastlane/AVD_setup.json", AVD_recreate_new: false, AVD_clean_after: false, gradle_task: "connectedDebugAndroidTest") end desc "Run instrumentation tests in Firebase Test Lab" lane :instrumentation_tests_testlab do run_tests_firebase_testlab( project_id: "project-id", model: "Nexus6P", version: "27", delete_firebase_files: true) end end ```
`./fastlane/Appfile` ```ruby json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one package_name("") # e.g. com.krausefx.app ```
### fastlane gems | Gem | Version | Update-Status | | -------- | ------- | ------------- | | fastlane | 2.104.0 | ✅ Up-To-Date | ### Loaded fastlane plugins: | Plugin | Version | Update-Status | | ------------------------------------------- | ------- | ------------- | | fastlane-plugin-automated_test_emulator_run | 1.6.0 | ✅ Up-To-Date | | fastlane-plugin-run_tests_firebase_testlab | 0.2.0 | ✅ Up-To-Date |
Loaded gems | Gem | Version | | ------------------------------------------- | ------------ | | did_you_mean | 1.2.1 | | slack-notifier | 2.3.2 | | atomos | 0.1.3 | | CFPropertyList | 3.0.0 | | claide | 1.0.2 | | colored2 | 3.1.2 | | nanaimo | 0.2.6 | | xcodeproj | 1.6.0 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 1.8.0 | | unicode-display_width | 1.4.0 | | terminal-table | 1.8.0 | | plist | 3.4.0 | | public_suffix | 2.0.5 | | addressable | 2.5.2 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | tty-screen | 0.6.5 | | tty-cursor | 0.6.0 | | tty-spinner | 0.8.0 | | babosa | 1.0.2 | | colored | 1.2 | | highline | 1.7.10 | | commander-fastlane | 4.4.6 | | excon | 0.62.0 | | unf_ext | 0.0.7.5 | | unf | 0.1.4 | | domain_name | 0.5.20180417 | | http-cookie | 1.0.3 | | faraday-cookie_jar | 0.0.6 | | fastimage | 2.1.4 | | gh_inspector | 1.1.3 | | json | 2.1.0 | | mini_magick | 4.5.1 | | multi_json | 1.13.1 | | multi_xml | 0.6.0 | | rubyzip | 1.2.2 | | security | 0.1.3 | | xcpretty-travis-formatter | 1.0.0 | | dotenv | 2.5.0 | | bundler | 1.16.5 | | faraday_middleware | 0.12.2 | | naturally | 2.2.0 | | simctl | 1.6.5 | | uber | 0.1.0 | | declarative | 0.0.10 | | declarative-option | 0.1.0 | | representable | 3.0.4 | | retriable | 3.1.2 | | mime-types-data | 3.2018.0812 | | mime-types | 3.2.2 | | jwt | 2.1.0 | | signet | 0.9.2 | | memoist | 0.16.0 | | os | 1.0.0 | | googleauth | 0.6.6 | | httpclient | 2.8.3 | | google-api-client | 0.23.9 | | emoji_regex | 0.1.1 | | faraday | 0.15.3 | | openssl | 2.1.0 | | date | 1.0.0 | | fileutils | 1.1.0 | | ipaddr | 1.2.0 | | fastlane-plugin-automated_test_emulator_run | 1.6.0 | | fastlane-plugin-run_tests_firebase_testlab | 0.2.0 |
*generated on:* **2018-09-20**
bffcorreia commented 6 years ago

Cool @soulcramer :) I will close this issue, then. Feel free to open it if you still have any problem.