I am generating a signed apk through Android Studio, and even when creating a new keystore, Android Studio uses an old keystore. This occurs even by placing the signature data in the gradle. All my apks are coming out with the same SHA1.
Im already push Invalidate Caches and Restart and nothing changes.
you can also do app signing in build.gradle script like this:
android {
.....
signingConfigs {
release {
keyAlias 'alias'
keyPassword 'pass'
storeFile file('release.keystore')
storePassword 'pass'
}
debug {
keyAlias 'androiddebugkey'
keyPassword 'oass'
storeFile file('debug.keystore')
storePassword 'pass'
}
}
Related
an error occurred while trying to get the sha-256 fingerprint of the keystore file
Make sure you are using the debug.keystore
You can define it in gradle.
android {
// ...
signingConfigs {
debug {
storeFile file('../../../.android/debug.keystore')
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
}
}
//...
I have created keystore and and generated my app bundle.
The name of my build file is also app-release.aab but still google saying the the app is in debug mode even though I have done the steps mentioned in googles "Build and release an android app" doc.
Please help
Assuming you followed those steps to the letter, you have to edit your app-level build,gradle to look something like this and you have the key.properties file under android/.
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
I tried to open this GitHub project with Android Studio
https://github.com/SimpleMobileTools/Simple-Calendar
But sync failed because the system cannot find keystore.properties file.
I tried some solutions I found at other threads by commenting out release line in build.gradle, but it didnt work.
signingConfigs {
// release {
// keyAlias keystoreProperties['keyAlias']
// keyPassword keystoreProperties['keyPassword']
// storeFile file(keystoreProperties['storeFile'])
// storePassword keystoreProperties['storePassword']
}
}
I could be commenting out the wrong parts or there are other reasons.
Please advise.
If you want to use the same script, you have to create a keystore.properties in the root of your project with your values:
storePassword=123456
keyPassword=abcdef
keyAlias=myAlias
storeFile=../keystore.jks
You can find some tips here.
Otherwise you can have many options to configure the signing configs.
For example:
signingConfigs {
release {
storeFile file("release.keystore")
storePassword "******"
keyAlias "******"
keyPassword "******"
}
}
Other info in the official doc.
I'm trying to generate a signed apk but It fails with the error:
C:/some/random/path/keystorename.jks: The system cannot find the path specified.
Android is searching in the wrong path, also, i just created a new keystore, it is supposed to be there.
Build -> Clean project fixes this bug.
Did you try to add these info at your build.gradle (inside "android") ?
for Linux:
signingConfigs {
config {
storeFile file('/home/yourPathHere/myapp.keystore')
keyAlias 'yourAliasHere'
keyPassword 'KeyPasswordHere'
storePassword 'storePasswordHere'
}
}
for Windows:
signingConfigs {
config {
storeFile file('c:\yourPathHere\myapp.keystore')
keyAlias 'yourAliasHere'
keyPassword 'KeyPasswordHere'
storePassword 'storePasswordHere'
}
}
In Android gradle, I'm thinking of logging what I'm signed on with, by adding the println as below
signingConfigs {
debug {
storeFile file("./debug.keystore")
println('Sign with Debug')
}
release {
storeFile file("./release.keystore")
storePassword "XXX"
keyAlias "YYY"
keyPassword "ZZZ"
println('Sign with Release')
}
}
In the gradle console, it shows both
Sign with Debug
Sign with Release
I also tried project.logger.lifecycle as per https://stackoverflow.com/a/40895807/3286489. Same thing happen.
What I want is to only show the one that I'm actually sign with instead of both. How could I achieve that?