Logging in gradle when only code is executed - android

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?

Related

SigningConfig “release” is missing required property “storePassword”

So recently I'm experiencing the following error when running gradlew assembleRelease on my RN App:
SigningConfig “release” is missing required property “storePassword”.
To this date, I've already released a lot of versions of my app, but this started to happen recently in both my CI (Github) and locally.
My file keystore.properties is at the android root folder and configured with the proper values.
Besides that, my app/build.gradle also seems to be correct:
signingConfigs {
releaseStaging {
storeFile file(‘../keystores/liber-student-app.jks’)
storePassword keystoreProperties[‘SIGNING_KEYSTORE_PASSWORD’]
keyAlias keystoreProperties[‘SIGNING_KEY_ALIAS’]
keyPassword keystoreProperties[‘SIGNING_KEY_PASSWORD’]
}
release {
storeFile file(‘../keystores/liber-student-app.jks’)
storePassword keystoreProperties[‘SIGNING_KEYSTORE_PASSWORD’]
keyAlias keystoreProperties[‘SIGNING_KEY_ALIAS’]
keyPassword keystoreProperties[‘SIGNING_KEY_PASSWORD’]
}
}
I also tried hardcoding the storePassword values (as suggested in this other stackoverflow question), but that didn't work (exact same error)
I've stuck on this for the past 2 days, so please, help, thanks.

I can't publish myFlutter app because its saying its in debug mode although I have done all the steps nd generated key

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
}
}

Generating a signed apk with another keystore

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'
}
}

Android Generate Signed APK Error?

My first Android project is finish. I want to load Google Play.
when I make build -> Generate Signed APK give error android studio.
For Gradle-based projects, the signing configuration should be
specified in the Gradle build scripts.See the Gradle User Guide for
more info."
I tried to sign configs as this sample
signingConfigs {
release {
storeFile file("mykeystore")
storePassword "mypassword"
keyAlias "my alias"
keyPassword "mykeypassword"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
But I dont know mykeystore and my password and other infos.
release {
storeFile file("mykeystore") -> what is mykeystore ?
storePassword "mypassword" -> what is mypassword ?
keyAlias "my alias" -> what is myalias ?
keyPassword "mykeypassword" -> what is mykeypassword ?
}
I cant build apk my project. This is my first project.
I use android studio 2.0.11 and mac os x lion.
Please help. Sorry bad english.
Thanks.

"The signing configuration should be specified in Gradle build scripts"... I did it

I have a big issue when I come to sign my application: I have set the signing configuration in accordance with the doc:
signingConfigs {
release {
storeFile file("lomapnew.keystore")
storePassword "myPassword"
keyAlias "myAlias"
keyPassword "Something...."
}
}
But I still get this error message: "The signing configuration should be specified in Gradle build scripts"
I'm going to go out on a limb and guess that you haven't set the signing configuration for the release build type. The debug build type is automatic, so it's not obvious that this is a necessary step for all other build types, including release.
You can apply the signing config like so:
android {
signingConfigs {
// It's not necessary to specify, but I like to keep the debug keystore
// in SCM so all our debug builds (on all workstations) use the same
// key for convenience
debug {
storeFile file("debug.keystore")
}
release {
storeFile file("release.keystore")
storePassword "myPassword"
keyAlias "myAlias"
keyPassword "Something...."
}
}
buildTypes {
/* This one happens automatically
debug {
signingConfig signingConfigs.debug
}
*/
release {
signingConfig signingConfigs.release
}
}
}
I like to keep passwords out of my build file. Hence I create a properties file that I load with
def keystorePropertiesFile = rootProject.file("./local.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
Then I define signingConfigs like so:
signingConfigs {
releaseSigning {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['keystore.live.storepassword']
keyAlias = keystoreProperties['keystore.live.keyalias']
keyPassword = keystoreProperties['keystore.live.keypassword']
}
debugSigning {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['keystore.debug.storepassword']
keyAlias = keystoreProperties['keystore.debug.keyalias']
keyPassword = keystoreProperties['keystore.debug.keypassword']
}
}
This doesn't work well with the menu option "create Signed apk" so I create flavors:
productFlavors {
mydebug {
signingConfig signingConfigs.debugSigning
}
myrelease {
signingConfig signingConfigs.releaseSigning
}
}
and now the signingconfigs work with the run button on the toolbar. For a default keystore the local.properties looks like
ndk.dir=/opt/sdk/ndk-bundle
sdk.dir=/opt/sdk
storeFile=/home/christine/.android/debug.keystore
keystore.debug.storepasswd=android
keystore.debug.keyalias=androiddebugkey
keystore.debug.keypassword=android
keystore.live.storepasswd=android
keystore.live.keyalias=androiddebugkey
keystore.livetest.keypassword=android
In your Jenkins build script, you need to create a symbolic link from local.properties to where the properties file is on your build server.
Answer is already given but i would like to highlight the other ways also,
We can specify the information manually like below where we have to specify full path to our keystore location like this
signingConfigs {
release {
storeFile file('O:/Android/Projects/yourKeyStore.jks')
storePassword "qwerty"
keyAlias "yourProjectKeyAlias"
keyPassword "ProjectKeyPassword"
}
}
This can also be specified in Signing Report if you go in
File-->Project Structure
Choose your project app module and select the signing report where you can fill up the information and it will automatically add previous release information in the gradle file.
Finally you just have to add
signingConfig android.signingConfigs.release
in the buildTypes {...} section. That will complete the signing procedure.

Categories

Resources