1

I am running calabash-android in a docker file and when I run the calabash test I got the error

/usr/local/bundle/gems/calabash-android-0.7.2/lib/calabash-android/java_keystore.rb:6:in `initialize': No such keystore file '/home/core/Android/debug.keystore' (RuntimeError)

I have tried this this and not working for me.

Edit

After setting up the path the error is like

/lib/calabash-android/java_keystore‌​.rb:32:in `initialize': Could not list certificates in keystore. Probably because the password was incorrect. (RuntimeError) 
Community
  • 1
  • 1
Muneer Muhammed
  • 883
  • 3
  • 10
  • 29
  • Did you deleted your default keystore ie "debug.keystore"..Just check if it's still there.. You can find it usually here "C:\Users\username\.android" – Sunil Sunny Apr 08 '16 at 05:30
  • Actually I am running it from docker and it is available there. After setting up the path I got the error /usr/local/bundle/gems/calabash-android-0.7.2/lib/calabash-android/java_keystore.rb:32:in `initialize': Could not list certificates in keystore. Probably because the password was incorrect. (RuntimeError) – Muneer Muhammed Apr 08 '16 at 05:34
  • May be you have to set the password as well along with the path to keystore.... I don't know what this "calabash" is . – Sunil Sunny Apr 08 '16 at 05:55
  • It is an automated testing tool for android app. I have set the keystore path in it. I have set it like {"keystore_location":"/home/core/Android/debug.keystore","keystore_password":"android","keystore_alias":"androiddebugkey"} – Muneer Muhammed Apr 08 '16 at 05:59
  • And it was working for me in my local with the same apk and debug.keystore file. – Muneer Muhammed Apr 08 '16 at 06:01
  • Hmm ok ,.Sry man I have no idea.. – Sunil Sunny Apr 08 '16 at 06:09
  • That's ok. Thanks for the try. :) – Muneer Muhammed Apr 08 '16 at 06:11
  • try to delete .calabash_settings file – Michael Yurin Dec 24 '16 at 09:04

2 Answers2

0

It can be fixed by navigating to the /.android directory and remove the debug.keystore file if exist one and go try the command

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 

And following that navigate to the directory where the feature files exist and setup the calabash android by using the command

calabash-android setup

The resign the new debug.keystore file using the command

calabash-android resign <apk path>

And finally we can run the test by using the command

calabash-android run <apk path>
Muneer Muhammed
  • 883
  • 3
  • 10
  • 29
0

There's an interesting thing to note. If your keystore password has $, then you need to escape it in .calabash_settings file.

Look at the content of this file:

{"keystore_location":"my-release-keystore.jks","keystore_password":"abc$123","keystore_alias":"MyAlias"}

If you leave "abc$123" like this, you should get an error. Then you should escape the password like the following example:

{"keystore_location":"my-release-keystore.jks","keystore_password":"abc\\$123","keystore_alias":"MyAlias"}

Take a look at \\ for escaping special characters.

shimatai
  • 1,759
  • 16
  • 18