Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not inject dylib (RuntimeError) #301

Closed
MortenGregersen opened this issue Oct 13, 2015 · 2 comments
Closed

Could not inject dylib (RuntimeError) #301

MortenGregersen opened this issue Oct 13, 2015 · 2 comments

Comments

@MortenGregersen
Copy link
Contributor

The last few days I haven't been able to run my calabash tests on my app in the iOS Simulator with the injected dylib. It has all been working fine until then.

When I run the tests (which should inject the dylib) on the iOS Simulator I get an error saying that it couldn't load the file libarclite_iphonesimulator.a.
I checked the path mentioned and the .a file exists, but I can't see any file called arclite.o.

I have recently updated to Xcode 7.0 (and 7.0.1). Running Mac OS X Yosemite 10.10.5 (14F27), but can't update to Mac OS X El Capitan, because my VPN client doesn't support it yet.

$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

$ xcodebuild -version
Xcode 7.0.1
Build version 7A1001

$ calabash-ios version
0.16.4

$ gem list <a looong list, so here are the relevant ones>
calabash-android (0.5.14)
calabash-common (0.0.2, 0.0.1)
calabash-cucumber (0.16.4, 0.16.3)
cucumber (1.3.20)
cucumber-core (1.3.0, 1.2.0, 1.1.3)
run_loop (1.5.5, 1.5.4)

Here is the output of the run (loaded ruby files and unimportant steps redacted):

Code:
  * <lots of ruby files>

Features:
  * myapp/features/ui_tests/01-Menu-og-login.feature

Parsing feature files took 0m0.100s

Using the iphone5s_myapp profile...

 # language: da
Egenskab: Menu og login

Baggrund:                    # myapp/features/ui_tests/01-Menu-og-login.feature:5
error: libarclite_iphonesimulator.a(arclite.o) failed to load objfile for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
error: libarclite_iphonesimulator.a(arclite.o) failed to load objfile for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
Could not inject dylib (RuntimeError)

/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/dylib_injector.rb:110:in `block in retriable_inject_dylib'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:53:in `block in retriable'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `each'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `with_index'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `retriable'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/dylib_injector.rb:108:in `retriable_inject_dylib'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/core.rb:392:in `run_with_options'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop.rb:107:in `run'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:767:in `block in new_run_loop'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:765:in `times'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:765:in `new_run_loop'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:635:in `relaunch'
/Users/bdumgr/Desktop/MobilAutoTest/automated_tests/shared/ios/support/01_launch.rb:58:in `Before'

    Givet jeg ser loginskærmen # myapp/features/step_definitions/01_menu_login_steps.rb:90

  Scenarie: Login                                   # myapp/features/ui_tests/01-Menu-og-login.feature:9
    Så ser jeg "Sådan kommer du i gang"-dialogen    # myapp/features/step_definitions/01_menu_login_steps.rb:94
    ... other steps

  Scenarie: Introguide og alle menuknapper # myapp/features/ui_tests/01-Menu-og-login.feature:19
error: libarclite_iphonesimulator.a(arclite.o) failed to load objfile for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
error: libarclite_iphonesimulator.a(arclite.o) failed to load objfile for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
Could not inject dylib (RuntimeError)

/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/dylib_injector.rb:110:in `block in retriable_inject_dylib'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:53:in `block in retriable'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `each'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `with_index'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/retriable-2.0.2/lib/retriable.rb:48:in `retriable'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/dylib_injector.rb:108:in `retriable_inject_dylib'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop/core.rb:392:in `run_with_options'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/run_loop-1.5.5/lib/run_loop.rb:107:in `run'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:767:in `block in new_run_loop'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:765:in `times'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:765:in `new_run_loop'
/Users/bdumgr/.rvm/gems/ruby-2.2.1/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:635:in `relaunch'
/Users/bdumgr/Desktop/MobilAutoTest/automated_tests/shared/ios/support/01_launch.rb:58:in `Before'

    Når jeg logger ind                     # myapp/features/step_definitions/01_menu_login_steps.rb:152
    ... other steps

Failing Scenarios:
cucumber -p iphone5s_myapp myapp/features/ui_tests/01-Menu-og-login.feature:9 # Scenario: Login
cucumber -p iphone5s_myapp myapp/features/ui_tests/01-Menu-og-login.feature:19 # Scenario: Introguide og alle menuknapper

2 scenarios (2 failed)
15 steps (14 skipped, 1 passed)
4m40.963s

Here is the code which launches the app:

Before do |scenario|
  if ENV['USE_LOCAL_SERVER'] == '1'
    LocalServerHelper.start(ENV['PRODUCT'])
  end
  @calabash_launcher = Calabash::Cucumber::Launcher.new
  unless @calabash_launcher.calabash_no_launch?
    @calabash_launcher.relaunch({:inject_dylib => true})
    if ENV['USE_LOCAL_SERVER'] == '1'
      puts backdoor('calabashBackdoorSetServer:', 'http://127.0.0.1:4567/')
    end
    set_location(latitude: 55.692860, longitude: 12.599283)
    @calabash_launcher.calabash_notify(self)
  end
  ENV['RESET_BETWEEN_SCENARIOS'] = ''
  ENV['USE_LOCAL_SERVER'] = ''
end

Topic on Google Group: https://groups.google.com/forum/#!topic/calabash-ios/VDZbFdjYNrE

@jmoody
Copy link
Contributor

jmoody commented Oct 14, 2015

I have reproduced in Xcode 7.0.1. Not sure what the cause is yet.

@jmoody
Copy link
Contributor

jmoody commented Oct 26, 2015

@MortenGregersen

The cause is not that dylib injection failed. It is that the injection code is using the contents of stderr to test for failures. Checking the exit code of lldb in Xcode 5 and 6 was unreliable.

I am going to rewrite a portion of the code and see if we can this working again.

jmoody added a commit that referenced this issue Oct 27, 2015
Testing for stderr is not working.  External errors can cause
us to fail.

Could not inject dylib (RuntimeError) #301
@jmoody jmoody closed this as completed Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants