i created a key and generated a signed apk with the key created.
i used "Generate Signed apk" in android studio
then i used the keytool command to extract the SHA1 fingerprint and added to the firebase console in my app project settings
but still firebase does not work in release builds but works fine in debug variant.
android {
signingConfigs {
release {
storeFile file('C:\\folder\\signkey.jks')
keyAlias 'key0'
storePassword ********
keyPassword ********
}
}
compileSdk 31
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled = true
shrinkResources = true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
i checked gradle and the signing config is correctly configured and i tried generating another key but also didnt work
Related
How do I compile build variants locally while being opted in to Google Play app signing? They created my signing key and I therefore only have an upload key.
I would like to test my staging and release build variants locally, but Android studio requires me to create a signingConfig in my gradle file, with the path to my storeFile the storePassword, keyAlias and keyPassword. When I provide my upload key details and try to build the release or staging version for local testing purposes I just get 'Invalid keystore format'.
My build.gradle files looks something like the following (omitted my details and some buildType variables)
My signing config
signingConfigs {
config {
storeFile file('')
storePassword ''
keyAlias 'upload'
keyPassword ''
}
}
My buildTypes
buildTypes {
debug {
}
staging {
signingConfig signingConfigs.config
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
I'm using the newest version of Android Studio and I am looking at publishing an app on the Play store. Unfortunately when I generate a signed APK it only gives me the open to produce a JKS file. All the tutorials I've seen makes it look like you put an APK and that's what you get out, but those are using older versions of Android studio. Do I need to put the JKS file through something else, download an older version of Android Studio or am I missing a step? I'm really new at this and I'd appreciate any help I can get. Thanks!
You need to create a JKS file once. After that make sure You have something like this in Your gradle file, inside "android" part:
signingConfigs {
config {
keyAlias 'key'
keyPassword '123456'
storeFile file('../app/key/yourAppKey.jks')
storePassword '123456'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
After this part has been added just set build variant -> release and then use build -> build bundle/apk -> build apk
I have bought an android app source code from codecanyon. I want to generate android apk for distribution without android studio. Any alternative?
Reason:
I have some problem installing android studio in my pc which makes it impossible to use android studio.
You should specify signingConfigs and buildTypes in build.gradle's android block. For example:
android {
defaultConfig {
...
}
signingConfigs {
config {
keyAlias '...'
keyPassword '...'
storeFile file('../key.jks')
storePassword '...'
}
}
buildTypes {
debug {
useProguard false
minifyEnabled false
debuggable true
applicationIdSuffix '.debug'
}
release {
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
useProguard true
minifyEnabled true
debuggable false
shrinkResources true
}
}
}
Then from terminal or command prompt in root path of your project, run the following commands:
// To generate debug apk
gradlew assembleDebug
// To generate release apk
gradlew assembleRelease
yes you can do it in command line. see the tutorial from official site with this link
I have in my build.gradle:
android {
signingConfigs {
debug {
storeFile file("debug.keystore")
}
release {
try {
storeFile file("mykey.keystore")
storePassword "store_password"
keyAlias "myapp"
keyPassword "key_passowrd"
)
}
catch (ignored) {
throw new InvalidUserDataException("Something wrong")
}
}
}
buildTypes {
debug {
debuggable true
minifyEnabled false
versionNameSuffix '-DEBUG'
}
release {
debuggable false
minifyEnabled true
versionNameSuffix '-RELEASE'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
In build variant, I choose "release". Then, I run my app on connected device, however, Android Studio keep popping up dialog saying:
But I do have signing configuration...
In build output, I don't see that app-release.apk either :
Why I get the error then? My Android Studio version is 3.0.1
You forgot to provide a link to your signingConfigs:
buildTypes {
release {
signingConfig signingConfigs.release
...
}
debug {
signingConfig signingConfigs.debug
...
}
}
You forgot to specify which signing config should be used for build type
debug {
signingConfig signingConfigs.debug
}
Also signing config names should not (but may!) match build type names (eg you may define alpha and beta signing configs and use them as
debug {
signingConfig signingConfigs.alpha
}
By default gradle (android plugin) provides 'system' debug signing config so you may just skip it but it will be available (currently your build script overrides 'system' signing config
I've got a product with 2 flavors (prod and beta) and I'm trying to sign my debug builds with my release keystore when I click run from android studio. I've defined a release and debug signing config (they're the same) and pointed both release and debug buildTypes to their respective signingConfigs but when I click run with the prodDebug variant selected, I get the following error:
Error: The apk for your currently selected variant (XXXXXX-prod-debug-unsigned.apk) is not signed. Please specify a signing configuration for this variant (prod-debug).
Here's the relevant part of my build.gradle:
android {
signingConfigs {
release {
storeFile file("xxxxxx.keystore")
keyAlias "MyAlias"
storePassword System.getenv("KSTOREPWD")
keyPassword System.getenv("KEYPWD")
}
debug {
storeFile file("xxxxxx.keystore")
keyAlias "MyAlias"
storePassword System.getenv("KSTOREPWD")
keyPassword System.getenv("KEYPWD")
}
productFlavors.all { flavor ->
flavor.signingConfig signingConfigs.release
}
}
defaultConfig {
~unrelated stuff~
}
buildTypes {
release {
minifyEnabled true
proguardFiles xxxxxxxx
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
productFlavors {
beta {
applicationIdSuffix ".beta"
~unrelated stuff~
signingConfig signingConfigs.release
}
prod {
~unrelated stuff~
signingConfig signingConfigs.release
}
}
Anyone know how to configure this? I've tried specifying the signingConfig in the flavor block as well and that didn't work either