Signed APK Wizard Relative Path to Keystore - android

I want to store my key store in my Android studio Project so that I can use a relative path in the Generate Signed APK Wizard. But I cant see to figure out where the Signed APK Wizard is looking.
How can I use a relative path to my android studio project to my keystore for use with the Generate Signed APK Wizard?

I just tried in Android Studio 1.4 and it seems that the wizard uses paths relative to the project directory.
Example:
project directory /home/dev/project
module name app
keystore file /home/dev/project/app/keystores/debug.keystore
In the wizard following works for me app/keystores/debug.keystore (notice that path is relative - without leading slash).
Adding following to the build.gradle in module will use relative path to the debug.keystore as well (notice that the module name is not listed there as we are already inside the app module)
android {
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('keystore/debug.keystore')
storePassword 'android'
}
}
...
}

Related

I have a flutter app that has ci cd(code magic) & Google signin which fails because of SHA1 change?

gives: PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException: 10: , null)
I have a flutter app that has ci/cd & Google sign in which fails because of SHA1 change Because of the change of the machine that builds the apk in debug mode so how to make the google sign in work on the ci/cd apk or How to add the ci/cd machine SHA1 to firebase to. make the google sign in work?
You should create a separate signing key for the debug build type or copy the existing one which was created by your development machine.
Copy the debug signing key into your project folder and configure it in gradle.
Example: Create a signing key namend debug.keystore with the alias androiddebugkey and password android. Then create a folder named keystore in your android project directory and copy the keystore into it. You can assign a debug signing key in the app module's build.gradle file like this:
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('.././keystore/debug.keystore')
storePassword 'android'
}
release {
...
}
}
This way all developers and the CI/CD systems use the same debug signign key.
generate keystore like this answer here
open the keystore with keystore explorer here
copy SHA1 & add it to firebase android app
add the keystore to code magic

Unable to build a Release Signed Bundle(.aab) even though release.keystore file is exists

I have accidentally deleted .android folder. Then I have removed Android Studio completely from my Mac and then installed newly. Then I tried to create release signed bundle from Build -> Generate Signed Bundle / APK and given all the required details like release keystore file path, alias and password. Then I tired to generate .apk from .aab by using following command,
sudo bundletool build-apks --bundle=<.aab location> --output=<.apk location>
Then I got following message in terminal
INFO: The APKs will be signed with the debug keystore found at '/Users/<myfolder>/.android/debug.keystore'.
From the above message I understood that, keystore files are taken from .android folder. But in my .android folder only debug.keystore file is available, but not release.keystore file.
I assume this is the reason why i am unable to generate release signed bundle. If I am right,
How to have release.keystore file inside .android folder(I have a copy of release.keystore in android/app/release.keystore)?
Note: I am unable to generate release signed bundle since the time I deleted .android folder. Before that everything was just fine.
In build.gradle module app, let add some lines of code below:
signingConfigs {
release {
storeFile file('YOUR_KEYSTORE_FILE')
storePassword YOUR_STORE_PASSWORD
keyAlias YOUR_KEY_ALIAS
keyPassword YOUR_KEY_PASSWORD
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
And then retry the build aab command.

Android - My app can't find my Raw files when published

[EDIT: I have found that if I have "minifyEnabled true" set for release build, then I see the following issue. If removed, issue is resolved. Is this a bug?]
Original post:
I have my library that I am using in my app, as Library project. In that Library I am using raw files that are in "myLibrary\src\main\res" folder. I use resources?.openRawResource(R.raw.file) function to access the file.
This is working fine when I am developing project and run the app on my device. But when I download my published app from playstore, openRawResource() fails and returns nullpointerException.
I opened signed apk in win rar, the raw files are not in there.
Also, when I use the following config to build and install the app on my device using Android Studio, then it works fine.
signingConfigs {
config {
keyAlias 'abc'
keyPassword 'pass'
storeFile file
storePassword 'abcPass'
}
}
Can you tell me what possibly could be wrong?

android signing with platform keys versus uploadkeys

I am developing for a closed platform and need to sign my apk with platform keys to be able to read from certain protected libraries. since this app additionally is not available on the Google Play store, does this mean that I don't need to sign with any other public private key pair for a release build? currently my workflow is such that we first create the build with gradlew assembleRelease which I assume uses the local.properties to sign my apk given the current build.gradle setup:
release {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('./debug.keystore')
storePassword 'android'
}
if I am subsequently using apksigner to sign with the platform credentials, does that render the aforementioned release build.gradle config pointless?
So it looks like the gradle configuration is used for a particular build type, or the alternative is to use zipalign and apksigner on the apk generated from the gradle task. So if i wanted to continue using apksigner i should remove the build.gradle configuration. I guess theoretically it was signing again the app twice, but since the last one was the non-debug keys, it didn't really matter.
For reference:
https://developer.android.com/studio/build/building-cmdline#gradle_signing

How to setup intellij 14 to sign my android app without writing the keys to the build.gradle file?

I want to setup intellij 14 to sign my app like it is described here
enter link description here but my app is on github and I want to be able to commit the build.gradle file to.
How can I configure gradle to sign it but have the keys somewhere else?
One solution is to put the keys in a gradle.properties file in your project root. The values that you put in that properties file turn into global variables in the build.gradle script that you can refer to.
So, if you have a gradle.properties file with:
KEYSTORE=HelloConfig.keystore
KEY_ALIAS=HelloConfig
STORE_PASSWORD=laser.yams.heady.testy
KEY_PASSWORD=fw.stabs.steady.wool
you can then have a build.gradle with:
signingConfigs {
release {
storeFile file(KEYSTORE)
keyAlias KEY_ALIAS
storePassword STORE_PASSWORD
keyPassword KEY_PASSWORD
}
}
Use .gitignore to block having gradle.properties be committed to GitHub, and you are set.

Categories

Resources