Calabash Android:试图在APK上运行测试时的资产路径错误

时间:2021-03-05 19:58:59

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

Calabash Android操作系统在我的Mac OS X上运行得很好,但当我运行以下命令时,它会突然地、自发地运行……

calabash-android run

calabash-android运行

I received 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 appreciate any help; I am stumped and at my wits end over this.

我希望得到任何帮助;我被难住了,为此我束手无策。

2 个解决方案

#1


1  

1. As your first line of error states JDK found on PATH.

1。在路径上找到的JDK的第一行错误状态。

Kindly install JDK & give the proper path in CMD.

请安装JDK并在CMD中给出正确的路径。

2. You have to give absolute path for APK like calabash-android run path/to/apk.apk

2。你必须为APK提供绝对路径,比如calabash-android运行路径/to/ap . APK

3. Also, ensure you execute setup, build & resign this command before run.

3所示。另外,请确保在运行之前执行setup、build和quit这个命令。

To create proper .keystore file

calabash-android setup file.apk 

To instrument your app

calabash-android resign file.apk 

To build test server

calabash-android build file.apk

#2


0  

The path to the APK must be specified or one can navigate to the path of the APK.

必须指定APK的路径,否则可以导航到APK的路径。

The command as it should be run is calabash-android run /path/name.apk.

应该运行的命令是calabash-android run /path/name.apk。

#1


1  

1. As your first line of error states JDK found on PATH.

1。在路径上找到的JDK的第一行错误状态。

Kindly install JDK & give the proper path in CMD.

请安装JDK并在CMD中给出正确的路径。

2. You have to give absolute path for APK like calabash-android run path/to/apk.apk

2。你必须为APK提供绝对路径,比如calabash-android运行路径/to/ap . APK

3. Also, ensure you execute setup, build & resign this command before run.

3所示。另外,请确保在运行之前执行setup、build和quit这个命令。

To create proper .keystore file

calabash-android setup file.apk 

To instrument your app

calabash-android resign file.apk 

To build test server

calabash-android build file.apk

#2


0  

The path to the APK must be specified or one can navigate to the path of the APK.

必须指定APK的路径,否则可以导航到APK的路径。

The command as it should be run is calabash-android run /path/name.apk.

应该运行的命令是calabash-android run /path/name.apk。