Problem running Calabash script on Android build due to conflicting JSON versions

Description of the issue

Building an Android app with workflow that includes the standard step for running a calabash script.

Environment:

Android & Docker, on Ubuntu 16.04

Which build Step causes the issue and which version of the step?

Calabash Android UI Test v1.2.1

Reproducibility

  • The problem always occurs - it is not intermittent

Build log

The relevant part of the build log appears below. You can see the critical line is:

Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)

How do I resolve this conflict in JSON versions?

Configs:
- WorkDir: .
- GemFilePath: ./Gemfile
- ApkPath: /bitrise/deploy/budget_refactor_build_of_branch_develop_b865-bitrise-signed.apk
- Options: --format html --out /bitrise/deploy/calabash-android_report.html
- AndroidHome: /opt/android-sdk-linux
- CalabashAndroidVersion: 

Determining calabash-android version...
Gemfile doest no find with calabash-android gem at: /bitrise/src/Gemfile
using calabash-android latest version

Installing calabash-android gem...
$ gem "install" "calabash-android" "--no-document"
Successfully installed gherkin-4.1.3
Successfully installed cucumber-core-1.5.0
Successfully installed builder-3.2.3
Successfully installed diff-lcs-1.3
Successfully installed multi_test-0.1.2
Successfully installed cucumber-wire-0.0.1
Successfully installed cucumber-2.4.0
Building native extensions.  This could take a while...
Successfully installed json-1.8.6

*****************************************************************
* To use the slowhandcuke formatter, simple add                 *
*   --format 'Slowhandcuke::Formatter'                          * 
* to your cucumber.yml, Rakefile, or command line call          *
*****************************************************************

Successfully installed slowhandcuke-0.0.3
Successfully installed awesome_print-1.7.0
Successfully installed escape-0.0.4
Successfully installed retriable-2.0.2
Successfully installed thor-0.19.4
Successfully installed luffa-2.0.0
Successfully installed calabash-android-0.9.0
15 gems installed

Search for debug.keystore...
using android debug keystore: /root/.android/debug.keystore

Resign apk with debug.keystore...
$ calabash-android "resign" "/bitrise/deploy/budget_refactor_build_of_branch_develop_b865-bitrise-signed.apk"


Running calabash-android test...
$ calabash-android "run" "/bitrise/deploy/budget_refactor_build_of_branch_develop_b865-bitrise-signed.apk" "--format" "html" "--out" "/bitrise/deploy/calabash-android_report.html"

No test server found for this combination of app and calabash version. Recreating test server.
Done signing the test server. Moved it to test_servers/10c3fb7b8636300522d41a6be11e21a9_0.9.0.apk
Unable to activate calabash-android-0.9.0, because json-2.0.2 conflicts with json (~> 1.8) (Gem::ConflictError)
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2288:in `raise_if_conflicts'
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:1408:in `activate'
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems.rb:220:in `rescue in try_activate'
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems.rb:213:in `try_activate'
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require'
/bitrise/src/features/support/env.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:142:in `load_file'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `load_files!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:253:in `load_step_definitions'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:61:in `run!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `execute!'
/usr/local/lib/ruby/gems/2.4.0/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>'
/usr/local/bin/cucumber:23:in `load'
/usr/local/bin/cucumber:23:in `<main>'

Failed to run command, error: exit status 1
Use Deploy to bitrise.io step to attach report file (/bitrise/deploy/calabash-android_report.html) to your build artifacts.

Failed to read output file (/bitrise/deploy/calabash-android_report.html), error: No file found at path: /bitrise/deploy/calabash-android_report.html
1 Like

Hi @rodbailey,

are you storing your ruby dependencies like calabash-android in Gemfile?

Could you please take a look on How to do Calabash UITesting on Bitrise .

1 Like