Calabash-ios dependancy error

141 views
Skip to first unread message

Jeff Hatfield

unread,
Sep 22, 2014, 12:33:29 PM9/22/14
to calaba...@googlegroups.com
I'm having an issue with calabash-cucumber as of late. I came back after a short vacation, updated to the new 0.10.1 and now I'm getting what I assume to be a dependency error:

invalid XML: #<ArgumentError: wrong number of arguments (0 for 1+)>
  /Users/jhatfield/.rvm/gems/ruby-2.1.0/gems/calabash-cucumber-0.10.1/lib/calabash-cucumber/core.rb:876:in `tap'
  /Users/jhatfield/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/rexml/parsers/baseparser.rb:184:in `pull'
  /Users/jhatfield/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/rexml/parsers/treeparser.rb:22:in `parse'
  /Users/jhatfield/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/rexml/document.rb:283:in `build'
  /Users/jhatfield/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/rexml/document.rb:44:in `initialize
...
...
...
wrong number of arguments (0 for 1+)
  Line: -1
  Position: -1
  Last 80 unconsumed characters:
   (CFFormatError)
  /Users/jhatfield/.rvm/gems/ruby-2.1.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbREXMLParser.rb:26:in `rescue in load'
  /Users/jhatfield/.rvm/gems/ruby-2.1.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbREXMLParser.rb:14:in `load'
  /Users/jhatfield/.rvm/gems/ruby-2.1.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbCFPropertyList.rb:348:in `load'
  /Users/jhatfield/.rvm/gems/ruby-2.1.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbCFPropertyList.rb:248:in `initialize'

What I've done:
  1. Tried reverting to the old 0.10.0
  2. Changed my Gemfile's calabash-cucumber version
  3. bundle install/update
  4. uninstalled calabash-cucumber - reinstalled calabash-cucumber
  5. Changed back to XCode 6 GM
  6. Tried launching calabash-android (works just fine)
Here's my Gem List:

  • *** LOCAL GEMS ***
  • ansi (1.4.3)
  • awesome_print (1.2.0)
  • bigdecimal (1.2.3)
  • briar (1.1.3, 0.1.3)
  • builder (3.2.2)
  • bundler (1.6.1)
  • bundler-unload (1.0.2)
  • calabash-android (0.5.2)
  • calabash-common (0.0.1)
  • calabash-cucumber (0.10.1)
  • CFPropertyList (2.2.8)
  • coderay (1.1.0)
  • columnize (0.8.9)
  • cucumber (1.3.17)
  • debugger (1.6.8)
  • debugger-linecache (1.2.0)
  • debugger-ruby_core_source (1.3.5)
  • diff-lcs (1.2.5)
  • dotenv (0.11.1, 0.9.0)
  • dotenv-deployment (0.0.2)
  • edn (1.0.6)
  • escape (0.0.4)
  • executable-hooks (1.3.1)
  • faker (1.4.3)
  • gem-wrappers (1.2.4)
  • geocoder (1.1.9)
  • gherkin (2.12.2)
  • httpclient (2.3.4.1)
  • i18n (0.6.11)
  • io-console (0.4.2)
  • json (1.8.1)
  • logger (1.2.8)
  • method_source (0.8.2)
  • mime-types (1.25.1)
  • minitest (4.7.5)
  • multi_json (1.10.1)
  • multi_test (0.1.1)
  • pry (0.9.12.6)
  • psych (2.0.2)
  • rack (1.5.2)
  • rack-protection (1.5.3)
  • rainbow (2.0.0, 1.99.2)
  • rake (10.3.2, 10.1.0)
  • rbx-require-relative (0.0.9)
  • rdoc (4.1.2, 4.1.0)
  • rest-client (1.6.8)
  • retriable (1.3.3.1)
  • rubygems-bundler (1.4.3)
  • rubyzip (1.1.6)
  • run_loop (1.0.4)
  • rvm (1.11.3.9)
  • sim_launcher (0.4.11)
  • sinatra (1.4.5)
  • slop (3.6.0)
  • slowhandcuke (0.0.3)
  • syntax (1.2.0, 1.0.0)
  • test-unit (2.1.0.0)
  • thor (0.19.1)
  • tilt (1.4.1)
  • xamarin-test-cloud (0.9.37)

Jeff Hatfield

unread,
Sep 24, 2014, 12:30:50 PM9/24/14
to calaba...@googlegroups.com
Anyone have any ideas on this? I'm still having the issue

Jeff Hatfield

unread,
Sep 24, 2014, 1:56:48 PM9/24/14
to calaba...@googlegroups.com
For whatever reason, deleting the 'tap' method in core.rb did the trick. I'm now able to launch the app correctly. I'm still having keyboard problems (I have to press cmd+K to make it pop up for hte first time), but it's at least launching

Karl Krukow

unread,
Sep 24, 2014, 1:57:55 PM9/24/14
to calaba...@googlegroups.com
I think you may be overriding the built in Object.tap method in ruby with Calabash' tap method

On Wed, Sep 24, 2014 at 10:56 AM, Jeff Hatfield <inner...@gmail.com> wrote:
For whatever reason, deleting the 'tap' method in core.rb did the trick. I'm now able to launch the app correctly. I'm still having keyboard problems (I have to press cmd+K to make it pop up for hte first time), but it's at least launching

--
You received this message because you are subscribed to the Google Groups "calabash-ios" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calabash-ios...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karl Krukow

unread,
Sep 24, 2014, 1:58:17 PM9/24/14
to calaba...@googlegroups.com
Check that your not including Calabash::Cucumber::Core or Operations at the top level in a script

Jeff Hatfield

unread,
Sep 24, 2014, 2:24:42 PM9/24/14
to calaba...@googlegroups.com
I double checked, I only include Calabash::Cucumber::Operations and only in 2 places. Neither are anywhere near the top or part of the script. 

This is offending method that was causing the crash from my code:

def reset_ios
     
@calabash_launcher = Calabash::Cucumber::Launcher.new
   
unless @calabash_launcher.calabash_no_launch?
       
@calabash_launcher.relaunch #THIS WAS CALLING THE TAP METHOD IN CORE.RB AT LINE 876
       
@calabash_launcher.calabash_notify(self)
   
end
     
#start_test_server_in_background
end

In that same file I only use: extend Calabash::Android::Operations

Jani Jegoroff

unread,
Oct 10, 2014, 3:48:23 PM10/10/14
to calaba...@googlegroups.com
Hi Karl, I get the same error with one of my experimental gems after upgrading to Calabash 0.11.0 from 0.9.169. Could you have a look and help me out to solve the issue?

Jani

Jani Jegoroff

unread,
Oct 12, 2014, 6:52:17 PM10/12/14
to calaba...@googlegroups.com
I added workaround to be able to run my tests again while using my experimental gems. This is how my env.rb look like:

require 'calabash-cucumber/cucumber'
require 'to_boolean'
require 'calios-uikit-extension'
require 'calios-uia-extension'

# Workaround for calios-uikit-extension and calios-uia-extension gems when using Calabash-ios version 0.11.0.
# Calabash::Cucumber::Core.tap method overwrites tap-method in Ruby Object class
# causing an error "CFFormatError: invalid XML: #<ArgumentError: wrong number of arguments (0 for 1+)".
# Calabash::Cucumber::Core.tap method is deprecated and can be safely removed.
Calabash::Cucumber::Core.send(:remove_method, :tap) if Calabash::Cucumber::Core.method_defined?(:tap)

Addionally, if I want to use my gems also in calabash-ios console I need to remove whole Calabash::Cucumber::Core.tap method.
Reply all
Reply to author
Forward
0 new messages