Calabash Android: Asset Path Error When Trying to Run an APK Test

Calabash Android worked fine on my Mac OS X, and then suddenly and spontaneously, whenever I ran the following command ...

launch of the calabash android

I got the following error:

2014-03-03 17:48:38 - JDK found on PATH. 2014-03-03 17:48:38 - Android SDK found at: /Applications/AndroidStudio.app/sdk/ 2014-03-03 17:48:38 - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S cucumber -v Code: * features/support/env.rb * features/support/app_installation_hooks.rb * features/support/app_life_cycle_hooks.rb * features/support/hooks.rb * features/step_definitions/calabash_steps.rb Features: * features/my_first.feature Parsing feature files took 0m0.003s Feature: Login feature Scenario: As a valid user I can log into my app # features/my_first.feature:3 2014-03-03 17:48:38 - First scenario in feature - reinstalling apps 2014-03-03 17:48:38 - connected_devices: ["6b5140a7"] 2014-03-03 17:48:38 - "/Applications/AndroidStudio.app/sdk//platform-tools/adb" -s 6b5140a7 forward tcp:34777 tcp:7102 2014-03-03 17:48:38 - W/asset ( 4263): Asset path is neither a directory nor file (type=1). ERROR: dump failed because assets could not be loaded 'package' not found in aapt output (RuntimeError) /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/helpers.rb:10:in `package_name' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:72:in `uninstall_apps' /Users/Nauman/Desktop/APKs/features/support/app_installation_hooks.rb:22:in `Before' W/asset ( 4265): Asset path is neither a directory nor file (type=1). ERROR: dump failed because assets could not be loaded 'package' not found in aapt output (RuntimeError) /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/helpers.rb:10:in `package_name' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:448:in `wake_up' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:477:in `start_test_server_in_background' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background' /Users/Nauman/Desktop/APKs/features/support/app_life_cycle_hooks.rb:5:in `Before' When I press "Login" # calabash-android-0.4.20/lib/calabash-android/steps/press_button_steps.rb:17 Then I see "Welcome to coolest app ever" # calabash-android-0.4.20/lib/calabash-android/steps/assert_steps.rb:5 2014-03-03 17:48:39 - java -jar /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/lib/screenshotTaker.jar 6b5140a7 screenshot_0.png 2014-03-03 17:48:40 - It looks like your app is no longer running. It could be because of a crash or because your test script shut it down. HTTPClient::KeepAliveDisconnected (HTTPClient::KeepAliveDisconnected) /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:882:in `block in parse_header' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:97:in `timeout' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:875:in `parse_header' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:858:in `read_header' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:667:in `get_header' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1137:in `do_get_header' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1086:in `do_get_block' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `block in do_request' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:986:in `rescue in protect_keep_alive_disconnected' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:980:in `protect_keep_alive_disconnected' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:774:in `request' /Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:684:in `post' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:334:in `make_http_request' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:290:in `http' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:556:in `shutdown_test_server' /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:97:in `shutdown_test_server' /Users/Nauman/Desktop/APKs/features/support/app_life_cycle_hooks.rb:12:in `After' Failing Scenarios: cucumber features/my_first.feature:3 # Scenario: As a valid user I can log into my app 1 scenario (1 failed) 2 steps (2 skipped) 0m2.432s 

I would be grateful for any help; I'm at a standstill and can handle it in the end.

+6
source share
2 answers

1. How does your first line of error contain the JDK found on PATH.

Please install JDK and specify the correct path in CMD.

2. You must specify an absolute path for the APK, for example calabash-android run path/to/apk.apk

3. Also, make sure you run setup , build and resign this command before run .

To create the correct .keystore file

 calabash-android setup file.apk 

To set up the application

 calabash-android resign file.apk 

To create a test server

 calabash-android build file.apk 
+1
source

You must specify the path to the APK or to go to the path to the APK.

The command to be launched is calabash-android run /path/name.apk .

0
source

All Articles