Invalid keystore format - android

I was given a keystore file along with an username and password and I need to sign the updated application. However, I am getting "keytool error: java.io.IOException: Invalid keystore format" when trying to list the contents of the file, trying to create a new key in the keystore, etc.
I have looked at the similar posts, but none of them helped me.
I am looking forward to hearing a solution. Thanks in advance

It turned out that the file was an RAR archive file that contained the actual keystore.

Related

Error while build an signed apk. The error is "Keystore was tampered with, or password was incorrect"

I have tried so many ways... And I have tried so many comments, but I got the same error. But my passwords are correct. When I created that, I noted that. I have tried without entering a password in another(keystore1) keystore, I got the mentioned error "Cannot load key store: keystore password was incorrect". But this(problem having keystore) keystore throws "Cannot load key store: Keystore was tampered with, or password was incorrect". Could anyone help with this? Whatever comment I have used throws the same error.
Please help me with this...

How to reuse an android key to release application

I created a key for my application on my laptop and released my application. Now I just copied that key into a flash and now I want to reuse it again, But I get this error:
Error:Execution failed for task ':app:packageRelease'.
> com.android.ide.common.signing.KeytoolException: Failed to read key key0 from store "E:\Rasad\Key\RasadKey.jks": Keystore was tampered with, or password was incorrect
I just test this path again with a new key and it happened again!
What is the problem?
Thankyou for your answers.
Copy the ".jks" file and enter the same password you have used before. When generating signed apk, choose existing instead of new. Hope it helps
It's very likely that you have provided either the wrong key store password, or the wrong key password. There's an easy way to check with keytool:
Check android keystore keypass for correctness

How to solve a Secret file bindings issue

I have a problem with one of my jenkins build.
I have configured in my global credentials, a keystore for one of my android build. This keystore is needed for when I have to sign my apk in order to distribute my app on Google Play for example.
So in the job, I have configured a Secret file binding to allow jenkins to copy the keystore file to a temporary location and sets a variable, let's call it SECRET_PATH, to that location. I can then provide gradle with the value of this variable on the command line when invoking the gradle script (in the switches section).
But then the build fails each time :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myapp:packageRelease'.
> Failed to read key ******** from store "/home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore": Keystore was tampered with, or password was incorrect
it is as if the location /home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore didn't even exist.
In the job configuration, the help tip on the Bindings sections also mentions this :
Warning: if the master or slave node has multiple executors, any other build running concurrently on the same node will be able to read the contents of this file.
It is exactly as if another concurrent build were running and deleted the location where the keystore was. This is really weird.
One more thing, I am using a master/slave topology where everything is dockerized. Not sure the docker itself is involved though. I think it's purely a Jenkins issue but I am giving this information so that you guys have some context.
Have you guys ever experienced this weird behaviour where jenkins seems to be unable to "resolve" the secret file bindings ?
Any help would be really appreciated.
thanks in advance,
Failed to read key ******** from store "/home/jenkins/slave/secretFiles/3607aab3-6e27-497a-b198-7d9a3aeb2913/keystore": Keystore was tampered with, or password was incorrect
it is as if the location /.../keystore didn't even exist.
No, the error message is correct — the file does exist, but most likely the store password or key password you are providing is incorrect.
If the keystore did not exist, you would get an error something like:
File '/.../release.keystore' specified for property 'signingConfig.storeFile' does not exist.
You can double check this by running file $SECRET_PATH/keystore, or ls -l $SECRET_PATH/keystore, or using keytool or something similar.
You don't mention injecting the keystore and key password(s) at all into the job — how are you doing that?
First make sure that building and signing the release version works as expected with Gradle from the command line.
Then you could try doing the same in Jenkins, by passing in the filename and password via the Gradle step (though this isn't a great idea if you're using the Job Config History plugin, for example).
Once that works, you can use the credential binding plugin to inject the file, and to inject the password.

Error with keystore : Parse Generalized time, invalid format

I get the following error when I to use my keystore :
$ keytool -list -keystore instavert.keystore
keytool error : java.security.cert.CertificateParsingException: java.io.IOException: Parse Generalized time, invalid format
I searched on Google and SO, but none of the solution worked...
Did anyone ever experienced the same issue?
You get this exception when you specified too big value for validity. Keytool does not do a great job on input validation when creating the keys and then it is not able to read the generated keystore. It is better to keep a backup from the keystore.

Value for 'keystore' is not valid. It must resolve to a single path

i am trying to build apk from command line with ant. I am able to create build in debug mode while getting this error when i run in release mode for signing the apk file with the key store generated.
my local.properties file look like this
sdk.dir=E:\\_WorkArea\\adt-bundle-windows-x86\\sdk
key.store=C:\Users\\l.keystore
key.alias=tys
key.store.password=tr
key.alias.password=tre
D:\Android-Sdks\tools\ant\build.xml:1132: The following error occurred
while executing this line:
D:\Android-Sdks\tools\ant\build.xml:1144: Value for 'keystore' is not
valid. It must resolve to a single path
i got the same problem with you.
you miss the "\" at key.store value
Note:
key.store=C:\\Users\\l.keystore
#cavallo answer is incorrect
It is not at all mandatory for keystore to be in the same folder.
The solution for you might have worked because the relative path would contain any slashes to be escaped.
Don't mislead others by accepting wrong answers of yours.
This was resolved by the keystore and the project has to be on the same folder... thats what it means by saying It must resolve to a single path..resolved myself....kudos
I had this message as well. It turned out my problem was actually in the ant.properties file where the keystore path contained an error. Changing that fixed it.

Categories

Resources