fix: add signing config so release APK can be installed
All checks were successful
Build & Deploy APK / build (push) Successful in 1m53s
All checks were successful
Build & Deploy APK / build (push) Successful in 1m53s
The release build had no signing config, producing an unsigned APK that Android refuses to install. Added debug keystore signing for release builds and a CI step to ensure the keystore exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,22 @@ jobs:
|
|||||||
echo "sdk.dir=$ANDROID_HOME" > local.properties
|
echo "sdk.dir=$ANDROID_HOME" > local.properties
|
||||||
cat local.properties
|
cat local.properties
|
||||||
|
|
||||||
|
- name: Ensure signing keystore
|
||||||
|
run: |
|
||||||
|
KEYSTORE="$HOME/.android/debug.keystore"
|
||||||
|
if [ ! -f "$KEYSTORE" ]; then
|
||||||
|
mkdir -p "$HOME/.android"
|
||||||
|
keytool -genkeypair -v \
|
||||||
|
-keystore "$KEYSTORE" \
|
||||||
|
-alias androiddebugkey \
|
||||||
|
-keyalg RSA -keysize 2048 -validity 10000 \
|
||||||
|
-storepass android -keypass android \
|
||||||
|
-dname "CN=Android Debug,O=Android,C=US"
|
||||||
|
echo "Generated debug keystore"
|
||||||
|
else
|
||||||
|
echo "Keystore already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build Release APK
|
- name: Build Release APK
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ android {
|
|||||||
namespace = "pl.firmatpp.itstransport"
|
namespace = "pl.firmatpp.itstransport"
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
create("release") {
|
||||||
|
storeFile = file("${System.getProperty("user.home")}/.android/debug.keystore")
|
||||||
|
storePassword = "android"
|
||||||
|
keyAlias = "androiddebugkey"
|
||||||
|
keyPassword = "android"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "pl.firmatpp.itstransport"
|
applicationId = "pl.firmatpp.itstransport"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
@@ -36,6 +45,7 @@ android {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
|
signingConfig = signingConfigs.getByName("release")
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = false
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
|||||||
Reference in New Issue
Block a user