"RuntimeError: App did not start" Error.

1,809 views
Skip to first unread message

Riyazul Aboobucker

unread,
Feb 11, 2014, 6:49:36 AM2/11/14
to calabash...@googlegroups.com
Hello,

I was working on Calabash for iOS and now trying to implement in Android.

I followed installation steps from Calabash-Android in Github. I also referred this blog

But how many ever times I re-install the apk, i keep getting "RuntimeError: App did not start" Error. 


Below is the log i got when i tried to run in console:

RiyazsMacyo:LearnAlphabets riyazul$ calabash-android console $APK_FILE 

irb(main):001:0> reinstall_apps

1459 KB/s (10725556 bytes in 7.178s)

1756 KB/s (556192 bytes in 0.309s)

nil

irb(main):002:0> start_test_server_in_background

RuntimeError: App did not start

from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:505:in `block in start_test_server_in_background'

from /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'

from /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'

from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:504:in `start_test_server_in_background'

from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background'

from (irb):2

from /usr/bin/irb:12:in `<main>'


Below is the log i got when i tried to run directly using "run" command:


RiyazsMacyo:LearnAlphabets riyazul$ calabash-android run /Users/riyazul/Desktop/LearnAlphabets/bin/LearnAlphabets.apk 

Feature: Login feature


  Scenario: As a valid user I can log into my app # features/my_first.feature:3

802 KB/s (556192 bytes in 0.676s)

1623 KB/s (10725556 bytes in 6.452s)

  App did not start (RuntimeError)

  /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:505:in `block in start_test_server_in_background'

  /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'

  /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'

  /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:504: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/riyazul/Desktop/LearnAlphabets/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

      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/riyazul/Desktop/LearnAlphabets/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)

0m52.142s



Please tell me what I'm doing wrong. Any help will be much appreciated. 

Thanks in advance
-Riyaz

Riyazul Aboobucker

unread,
Feb 14, 2014, 1:03:15 AM2/14/14
to calabash...@googlegroups.com
Someone please help. :/

Ashutosh

unread,
Feb 14, 2014, 2:22:21 AM2/14/14
to calabash...@googlegroups.com
In your Android app’s manifest, aka AndroidManifest.xml, include the line:
<uses-permission android:name="android.permission.INTERNET" />
You can take a look at these links too:
http://www.luisdelarosa.com/2013/04/18/how-to-fix-problem-when-app-wont-start-when-testing-with-calabash-android/

On Friday, 14 February 2014 11:33:15 UTC+5:30, Riyazul Aboobucker wrote:
Someone please help. :/

Riyazul Aboobucker

unread,
Feb 14, 2014, 4:37:13 AM2/14/14
to calabash...@googlegroups.com
I already added that line in AndroidManifest.xml as per the instructions i followed during installation.

Yet it doesn't work. 

Melissa

unread,
Feb 21, 2014, 10:14:21 AM2/21/14
to calabash...@googlegroups.com
Hello Riyazul,

I had this same error when I updated my Calabash-Android to the latest version.

The solution that worked for me was to:
1) either downgrade Calabash to an older version (I got the 0.4.3)
2) or you copy/paste the HTTP function on the operations.rb file from 0.4.3 version onto the latest version of your operations.rb file.

As a side note: I use Calabash inside a VirtualBox running Ubuntu, so I'm not sure if this solution above will work for you too.

Riyazul Aboobucker

unread,
Feb 25, 2014, 3:54:27 AM2/25/14
to calabash...@googlegroups.com
Thanks Melissa.

I actually figured out the problem and resolved it.
I resigned the .apk file manually using re-sign.jar software. Due to this it didn't work. 
I ran the original .apk file without re-signing and i worked.

Thanks everybody.

AYUSH ANUJ

unread,
Mar 4, 2014, 2:11:33 AM3/4/14
to calabash...@googlegroups.com
Hi  Riyazul, i am also facing the exact problem when i used the signed apk file but when i try to run unsigned .apk, its giving an error " NO RSA file found in META-INF. Cannot proceed <Runtime error>  I have used the following command to sign the apk file: C:\Users\<UserName>\.android> jarsigner -keystore debug.keystore -storepass android -keypass androidAndroidDemoProject.apk androiddebugkey . Please help me as i got stuck here My calabash-android version is 0.4.18.
Thanks

Riyazul Aboobucker

unread,
Mar 4, 2014, 2:15:32 AM3/4/14
to calabash...@googlegroups.com
Try resigning using calabash. As in, calabash-android resign "apt file name".apk.

When i faced the problem, i ran .apk file without resigning. It worked.

arihan sinha

unread,
Nov 18, 2014, 9:42:12 AM11/18/14
to calabash...@googlegroups.com
how to run without resigning the apk.???

when i run this calabash-android console xyz.apk

it tries to sign it.  However we have the apk which need to be signed on a specific keystore. so I have done the calabash-android setup to give the path of keystore, password and alias.

so resign done and apk moved to testserver.


when i start the calabash-android console xyz.apk and in the irb does the reinstall_apps and then start_test_server_in_background it gives the error as

RuntimeError: App did not start

from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:512:in `block in start_test_server_in_background'

from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'

from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:53:in `retriable'

from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:511:in `start_test_server_in_background'

from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:92:in `start_test_server_in_background'


Also when manually checked in the android device , the app does not start .

Надежда Потаенко

unread,
Sep 16, 2016, 3:28:32 AM9/16/16
to calabash-android

You can try this way. Inside your ruby folder find file operations.rb. Path is like this "C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\calabash-android-0.7.3\lib\calabash-android". Open the file and find the block of code:

    Retriable.retriable :tries => 100, :interval => 0.1 do
              raise "App did not start" unless app_running?

Change "tries" parameter value on 300 instead of 100. It will help your app run in case of insufficiently productive device. We've tested 6 different devices with default settings, but only 2 flagship smartphones (Samsung galaxy S6) could run app with "tries" parameter value => 100. Now all our devices can run apps great!


вторник, 18 ноября 2014 г., 21:42:12 UTC+7 пользователь arihan sinha написал:
Reply all
Reply to author
Forward
0 new messages