Unable to sign the android apk while using calabash - android

I am trying to use calabash tool for automation of android application, while signing application I got following error:
jarsigner error: java.lang.RuntimeException: keystore load:
C:\Users\pcadmin.INFPU08742\.keystore (The system cannot find the file specified)
I have debug.keystore file in ./android folder
Please let me know what is required?

How are you signing the apk? If it's through the terminal it can become quite a huge mess. At least that happened to me. A quick solution is simply to get the signed apk from eclipse -> right click on Application package(in package explorer) -> Android tools -> Export Signed apk. Just specify the keystore location and use android as password. That should do the trick.

Related

Keystore error when trying to run android calabash tests

I'm trying to run some calabash tests in RubyMine, to test a previously build .apk file.
When I try to run all features, the following error message pops up. I built the .apk file with AndroidStudio, not specifying a certain keystore, so I guess the "default" debug.keystore is used.
No MD5 fingerprint found:
Keytool Error: java.lang.Exception: Keystore file does not exist: X:/.android/debug.keystore
java.lang.Exception: Keystore file does not exist: X:/.android/debug.keystore
at sun.security.tools.KeyTool.doCommands(KeyTool.java:738)
at sun.security.tools.KeyTool.run(KeyTool.java:340)
at sun.security.tools.KeyTool.main(KeyTool.java:333)
(RuntimeError)
As far as I know the provided keystore for testing has to be the same as the one used when building the .apk, which should be the debug.keystore in my .android folder, since its the only one present on my computer.
I'm not sure why keytool tries to find the keystore file on the X:/ drive instead of the D:/ drive where the debug.keystoreexists.
Is there any way to tell keytool (or RubyMine) which keystore to use? Or may there be another problem I'm not aware of? Any hints or help would be appreciated.
Note: I was able to run the tests when using an older .apk. Only when I did some changes in the android code and build the app again the error occurred when trying to run the tests.
We try to autodetect the keystore. You can just use calabash-android setup to specify your keystore. Run the command from your test working directory.

Android Signing application on Windows

I am trying to Sign up APK to upload it on to the Play Store Market. I am following the steps underlined here
I am getting the following error
When i try to Sign the Application using Eclipse project->Android Tools->Export Signed Application Package.
You don't need to do it with commands. In Eclipse, right click on your project->Android Tools->Export Signed Application Package.
Follow the wizard and you will have an signed apk without pain.
Edit:
After a quick search about the new error, this thread seems to contain possible fix for you. At instance, please try to clean your project and build it again. If it does not fix your problem, also try the fix mentioned in the link.
Copy your keystore file to a directory which has no spaces. Your current path is C:\Program Files (x86)\Java\jdk1.6.0_27\bin\my-release-key.keystore which contains the directory Program Files (x86) with spaces. JarSigner cannot identify directories with spaces.

debug.Keystore format file i try to open it using notepad?

I am developing gps base app. For that i need the md5 so i have tried to open the file debug.keystore using notepad,so file format is change to notepad, now i have got the google-apiKey using key-tool menu (install plug-in keytool ), but problem is that when run my app it give me the following error
Error generating final archive: java.io.IOException: Invalid keystore format Unknown Android Packaging Problem
I am not even sure where to begin to look. I cannot launch the application. Can someone give me an idea on what area I can look into?
A
I am solve this problem
Delete your debug certificate under ~/.android/debug.keystore on Linux and Mac OS X; the directory is something like %USERPROFILE%/.androidon Windows.
The Eclipse plug-in should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.
Your debug keystore was created automatically

Does IntelliJ IDEA publish an Android app with one click?

On Android developer's page (http://developer.android.com/guide/publishing/app-signing.html) there is a tutorial on publishing which says that an app has to be compiled as an unsigned app, a private key must be generated with keytool then signed with jarsigner.
How do we create an unsigned app with IntelliJ?
Alternatively, can we do all these steps via Tools->Android->Export Signed Android Package?
Thanks in advance!
New IDEA versions have an option to generate unsigned APK in the Android Facet settings, Compiler tab:
However you don't need to do that if you use the Export Signed Android Package feature:
Tools | Android | Export Signed Android Package will generate the release version of your application signed with the release key and ready for Market.
You can also create a batch file that will sign the unsigned APK and configure it as an External Tool in IDEA so that you can generate it in one click or via keyboard shortcut (if you are OK with a batch file containing your keystore passwords in open text).
I use such script to generate the signed APK, upload it to a phone and start the main Activity to perform application testing, it has the following sequence of actions:
jarsigner
zipalign
adb install
adb start
EDIT 2013/2/8: The option to export a Signed APK is now under Top Menu > Build > Generate Signed APK (IntelliJ IDEA 12)
IDEA 12 has even better way to do it via artifact, configured like this:
Then use Build | Build Artifacts when you need to make a release version.
Well you could modify the ant scripts slightly and have one target which builds a final signed APK. So that technically could be a one click build. Not sure about publishing, you may be restricted to using the web interface to upload and publish the app.
I wrote a tutorial on publish, it might be worth a read as I cover some of the building final releases and such

How to zipalign the .apk file using eclipse?

Can anyone tell me how to zipalign my .apk file with using eclipse. I have made my .apk file by giving command like,
Right Click on Project Folder
Click on "Android Tools" option from menu.
Click on "Export Signed Application Package..." and my .apk generated in given application alias.
Now want to do zipalign for this above generated .apk file. Does any tool require to do so OR anything that can solve my problem.
If you did what you described above then Eclipse has already zipaligned your apk for you. You can't zipalign an already zipaligned package
I think this will help you
D:\android-sdk\android-sdk\tools>zipalign -f -v 4 "C:\Users\name\Desktop\project_name\projectname_signed.apk" "C:\Users\name\Desktop\project_name\projectname__zipaligned.apk"
Using the steps given, Eclipse will do zipalign for you.
This is a very tricky part and initially i was also ran in to strange problems . Before uploading to android market you must do the following steps.
Create a Certificate
Signing your application apk
Finally Zip align the signed apk
Check this site: How to sign Android project apk
Eclipse zipalign APKs when you export them by default.
zipalign is basically a tool available in tools directory of your android sdk.
In case you are not using eclipse to build, you can use this tool directly to zipalign your apk.
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
The alignment is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.
For more detail, check this link
http://developer.android.com/tools/help/zipalign.html
If you to signed and zip aligned your APK file, so that you could redistribute your file and upload it play store. Then follow these simple steps
Open Eclipse
File--> Export
Browse-->Select your project
Next-->Next
So, after all of that you will get an APK which will be signed and zip aligned.
Eclipse zipalign apk automatically. When you export the project, eclipse must be generating signed apk to a different destination. Check properly where it prompts when you generate a signed apk
Eclipse automatically zipaligns your .apk file if you did what you described above.

Categories

Resources