I am using android studio. The first time I generated signed apk, I went to build-> generate signed apk.
I created a Key Store at certain path with evry details(password, alias name,validity etc).
Every time I generate signed apk using this key. I select Release from the drop-down saying Build Type.
The apk gets generated and uploaded successfully.
I had to generate release key-hash, so I used the same keystore file that I generated from the build->generate signed apk menu. Will the key-hash generated be correct one?
ps: my keystore file doesn't have a .Keystore extension but it works
Related
Im working on a react-native android application in which I have decompiled the generated signed apk, made the changes in the code and recompiled the apk back with apktool and signed the same apk with a other certificate file which is not its original sign certifcate which I use to generate the release apk. I dont want it to get signed if my orginal certificate is not used for signing the modified apk. Is this possible ?
If you have not original certificate You cannot do that
I tried to take the release build in ionic 3 that already built the apk file with the key store and was uploaded in the play store.
Now I have made some changes in my code and I need to generate an apk and need to upload it to the play store with same JKS file.
Actually I need to update the next version of my app. How do I take the build in that same file?
When I run it shows:
Enter keystore password:
keytool error: java.lang.Exception: Key pair not generated, alias <my-alias> already exists
java.lang.Exception: Key pair not generated, alias <my-alias> already exists
at sun.security.tools.keytool.Main.doGenKeyPair(Main.java:1721)
at sun.security.tools.keytool.Main.doCommands(Main.java:1007)
at sun.security.tools.keytool.Main.run(Main.java:366)
at sun.security.tools.keytool.Main.main(Main.java:359)
Currrently i am using android 3.1.4 and when i try to generate signed apk using Build->Generate signed apk the apk file stores in
/app/release/app-release.apk
And i also configured the build process to automatically sign your APK using Open Module Settings. plz refer here .
And according to this document the location is
/build/app/outputs/apk/app-release.apk
So which apk file is correct/perfect for the play store publication?
/build/app/outputs/apk/app-release.apk
Or
/app/release/app-release.apk
both the APKs have their specific concerns.
the apk generated using normal build can be found here,
/build/app/outputs/apk/app-release.apk
in general, if you're in the development phase then we do not have to generate every time keystore details and all the security details. cause, we just have to test the changes after bugs resolved. so, the best usage of the application found using normal build is to test and debug your app.
while, the apk generated using generate signed apk can be found here,
/app/release/app-release.apk
signed apk requires keystore and password details. so, it is used to upload for your final build. when, you're 100% sure that the application is as per your requirement, only then you should generate a signed apk.
so, the answer for your question is, It is recommended that you upload an apk, which is generated using "Generate Signed APK".
tl;dr = Both are correct
let me Explain how
There is three types of APK
An unsigned APK
A signed Apk = Unsigned APK + Signing certificate key
A debug Apk = Unsigned APK + Debug certificate key
The automatic build process generate the same APK as you manually generate, if you configured it to automatically sign your APK.
so
If we don't want to sign our APK again and again then we can configure to get signed apk every time we build and the generated APK will go into
/build/app/outputs/apk/app-release.apk
and if we use Generate Signed APK
then the default path. (path can be changed)
/app/release/app-release.apk
Even you can generate an unsigned APK and later sign it and release. its also the same
here is the official documentation where it showing how you can sign an unsigned apk
and the last line of this documentation clearly saying
An APK signed with your private key is ready for distribution
Generally developer's find Generate Signed APK manually is better because maybe you made a change and forgot to build/run your code and picked older app-release.apk so generating manually means you are 100% sure that this one is latest
but if you just build and pick auto created release file then it's also correct and latest one
/app/release/app-release.apk
would be the one you're looking for. I found myself in a similar situation not so long ago
Android Key Generator screen in Android Studio
When I try to generate a signed apk in Android Studio I get this screen to generate a new key. I have made a folder 'Android Key' and when I set path to this folder the wizard is asking for File name .jks. Where can I find .jks ?
Signing Your App in Android Studio
To sign your app in release mode in Android Studio, follow these steps:
1.On the menu bar, click Build > Generate Signed APK.
2.On the Generate Signed APK Wizard window, click Create new to create a new keystore.
If you already have a keystore, go to step 4.
3.On the New Key Store window, provide the required information as shown in figure 1.
Your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app.
4.On the Generate Signed APK Wizard window, select a keystore, a private key, and enter the passwords for both. Then click Next.
5.On the next window, select a destination for the signed APK and click Finish.
To generate a signed apk, you will need a keystore. Follow this procedure to generate a keystore.
On the menu bar, click Build > Generate Signed APK.
On the Generate Signed APK Wizard window, click Create new to create a new keystore.
On the New Key Store window, provide the required information.
Save fileName.jks file and keep it safe.
Use this keystore file for signing your file in future.
I am creating an in-app purchase app. I have uploaded apk file once while creating the application in Google Play developer console. But now when I am trying to upload another version of apk file it is showing error of different SHA-1 keys. I have changed the version code and package name is also same. I referred questions here and I got to know that apk should be signed with same certificate.
But my problem is when I export the project from Eclipse to generate signed apk it is not allowing to use existing keystore; moreover when I select existing keystore the dropdown list of alias are empty. So each time I have to create new keystore. Also it is showing "Invalid keystore format" on selecting exiting keystore. Please provide me with some solution to how can I generate an APK with same SHA-1 key.
Is this apk file generated from another computer than the first?
Make sure to have the same .keyStore file on your different PC.