I'm trying to generate a signed APK for my app in Android Studio by going into Build->Generate Signed Bundle/APK , but I keep getting this error when I select the release build variant.
Execution failed for task ':app:packageRelease'.
Failed to read key keystore from store "C:\Users[PATH]\keystore.jks": Keystore was tampered with, or password was incorrect
I'm pretty sure that my password is correct because the apk generates correctly when I select the debug build variant instead of release. The keystore also works fine for my other projects.
I tried cleaning, rebuilding the project,invalidating the cache/restarting, and changing the destination folder, but nothing worked. Does anyone know why this is happening and how I could solve it?
Check your keystore file for first, in you example you creating file with name keystore.jks If its correct and really present in folder user check alias
Turns out that the problem was my build.gradle version.
Same solution as #S. Gissel in Cannot compile a signed APK in Android Studio 3.3
I was able to solve this by providing the specific file path of my .jks and not just the folder.
ex.
INCORRECT key store path
C:\Users\john\Desktop\Projects\ProjectName
CORRECT key store path
C:\Users\john\Desktop\Projects\ProjectName\helloworld.jks
Related
I have installed new version Android studio 3.4.2.
I developed few android project in older android studio version . But now I am not able to generate signed apk in 3.4.2 version. Unable to release next update. Can any body help me. Thanks in advance for your valuable time.
changing the path of destination apk to different path. (for C :) you might be able to solve it.
I had this problem and it was because I'd changed my project's folder name to something different, and the APK was still trying to be built to the original folder (which of course now no longer existed). Just update the output folder name in the dialog box to match what the project's new folder name now is.
Try and change the path of destination of your apk or reset your android studio
I had the same problem, after lots of debugging I could find a solution. it's super easy.
just make sure this two-path should be the same:
Project folder path:
Generate Signed Bundle or APK Destination Folder:
Check your project File Name may be you can change your project name,in my case i am facing same issue and try to search on google but didn't resolve then i saw my project name and it different's from designation folder where apk release.
Solution:
check the jks file path is correct
Take a look if the output path of the compiled package is correct
One of the following points can fix this issue.
invalidate cache and restart
update android SDK.
Just choose the destination path in Generate signed apk and bundle screen:-
Like mine is:-
project_destination\app\release
Android studio completes the building process then says that build failed
"I have tried cleaning the project & rebuilding it but it ends up with the same result"
output:
buildOutput.apkInfo must not be null
EDIT: I figured my problem here and it seems like some how my package changed and I fixed it with reversing the changes.
If you came here to solve a similar problem check this link first Cause: buildOutput.apkData must not be null
For Android Studio 3.5 Update. (APK signed issue)
I had the same issue. I have resolved this issue by modifying the Destination Folder.
Step by step
Build
Generate signed Bundle/APK
Select Android App Bundle or APK
Add Keystore
On Destination Folder: Change c:\user\folder\project\app to c:\user\folder\project\
Summary
Before
c:\user\folder\project\app
After
c:\user\folder\project\
In my case, just simple steps started to work:
Delete the build folder of App and inner Modules.
Clean Project.
Rebuild Project.
That's it.
When I try to load any project from GitHub and try to compile it on Android Studio (most newest version) I see same error message:
Gradle 'PROJECT NAME' project refresh failed Error: Password
verification failed
I tried to reinstall keystore file, delete and generate again gradles. No effect.
Also, it happens after some update. I can open old projects (both created by me and downloaded from GitHub).
Do anybody meet similar problems?
What did you try on reinstall? If nothing working, simply create new keystore, and it surely gets solved.
Build>Generate Signed Bundle/APK> APK > Create new > ...
And use this newly created keystore.
I am new to AndroidStudio and I have a fully functional AndroidProject in Eclipse, which I try to migrate to AndroidStudio.
Actually I have a signing problem when starting the app.
It says : The apk for the currently selected variant is not signed. Please specify a signing configuration for this variant (demo).
In Project Structure -> Tab : Signing I added a new Signing entry. For this i filled all 4 fields correctly.
I also checked the keystore and alias with :
"C:\Program Files\Java\jre1.8.0_77\bin\keytool" -list -keystore "C:\eclipse\keystore\mykeystore" -alias myalias
which was successfull.
But still I get this error.
I use also build variants (DEMO, FULL, TEST) and I am not sure if I have to assign the signings to variants ?
I am able to sign an app with using "build" -> "Generate Signed APK" , but not when starting the app.
Can someone help ?
You created the signing config. Now, you need to specify this sign for the build variants. Project structure -> Build types -> Signing config
I saw many tutorials in which the user is able to select the folder to create new keystore in....but in android studio 1.4.1.... I can only select *.jks files. Also I created a keystore using keytool (java) and then created the signed apk choosing existing keystore....I was able to create app-release.apk....but google is giving this error on upload
You uploaded an APK signed with a certificate that is not yet valid. You need to sign your APK with a certificate that is currently valid. Learn more about signing.
You need to use a different package name because "com.example" is restricted.
You cannot have certain names like com.example and com.google in your package name. Your package name has to be unique in play store.
Apart from that Android follows the same conventions for naming packages as Java does.
Generally to make it unique, the package is named like yourDomainNameInReverse.YourAppname
For example, the package name for Mozilla firefox android app is org.mozilla.firefox
if you are using android studio the change applicationId in build.gradle file.
your current app id id like applicationId "com.example.zyz" then change it to applicationId "com.testmyname.zyz"
no need to change/manage packages & code
Follow the steps
Select Project -> Click Build -> Click Generate Signed APK
then follow the process shown there..
For the first error:
You uploaded an APK signed with a certificate that is not yet valid. You need to sign your APK with a certificate that is currently valid.
Answer: I had to change my system date to two days back and then again generate the keystore. ....or you can simply wait till your certificate becomes valid.
For the second error:
You need to use a different package name because "com.example" is restricted.
Answer: In Android Studio go to the tree hierarchy and right click your package name folder under "app/java/your_package_name" and go to refractor and then rename. A pop up will appear....choose rename package and rename it to something else than default com.example.package_name. Also change it in AndroidManifest.xml file.