- compileSdk/targetSdk 36: Google Play rejects new apps below API 36 since 31 August 2026. - Release signing from ANDROID_KEYSTORE_* environment variables or local.properties; unsigned when no upload key is configured. - versionCode/versionName overridable via VERSION_CODE/VERSION_NAME. - scripts/build-release-aab.sh builds and verifies a signed AAB. - CI installs platform 36 until the CI image is rebuilt. - Document the internal-testing upload flow.
This commit is contained in:
1 parent
43bd9629d3
commit
9b105b3925
6 files changed
+179
-10
No files matched your search
@@ -60,15 +60,15 @@ composeApp/
|
||||
|
||||
## Build
|
||||
|
||||
Requirements: JDK 21, Android SDK 35 for the app target, Node (Kotlin downloads its own for web).
|
||||
Requirements: JDK 21, Android SDK 36 for the app target, Node (Kotlin downloads its own for web).
|
||||
|
||||
With Nix, everything is provided by `shell.nix` (JDK 21, Gradle 8, Node 22, Android SDK 35 with build-tools 35.0.0, and the desktop runtime libraries):
|
||||
With Nix, everything is provided by `shell.nix` (JDK 21, Gradle 8, Node 22, Android SDK 36 with build-tools 36.0.0, and the desktop runtime libraries):
|
||||
|
||||
```bash
|
||||
nix-shell
|
||||
```
|
||||
|
||||
The shell accepts the unfree Android SDK license for you; see the comment at the top of `shell.nix`. Without Nix, point `ANDROID_HOME` at an SDK containing platform 35 and build-tools 35.0.0.
|
||||
The shell accepts the unfree Android SDK license for you; see the comment at the top of `shell.nix`. Without Nix, point `ANDROID_HOME` at an SDK containing platform 36 and build-tools 36.0.0.
|
||||
|
||||
```bash
|
||||
export ANDROID_HOME=/opt/android-sdk
|
||||
@@ -95,11 +95,63 @@ Serve the web bundle from any static host (for example `python3 -m http.server`
|
||||
|
||||
Android cleartext HTTP is enabled for local development. Use HTTPS in production.
|
||||
|
||||
## Publishing to Google Play (internal testing)
|
||||
|
||||
The application id `win.taptap.musicmanager.client` is fixed after the first
|
||||
upload. Google Play requires new apps to target API 36, and every upload needs a
|
||||
higher `versionCode`.
|
||||
|
||||
### 1. Upload key (once)
|
||||
|
||||
Play App Signing keeps the real signing key; this project only needs an upload
|
||||
key. Create it and store the keystore plus both passwords in a password manager:
|
||||
|
||||
```bash
|
||||
keytool -genkeypair -v -keystore upload-keystore.jks -storetype PKCS12 \
|
||||
-alias upload -keyalg RSA -keysize 4096 -validity 10000
|
||||
```
|
||||
|
||||
Add the values to `local.properties` (git-ignored) or export them in CI:
|
||||
|
||||
```properties
|
||||
UPLOAD_STORE_FILE=/absolute/path/upload-keystore.jks
|
||||
UPLOAD_STORE_PASSWORD=...
|
||||
UPLOAD_KEY_ALIAS=upload
|
||||
UPLOAD_KEY_PASSWORD=...
|
||||
```
|
||||
|
||||
CI equivalents: `ANDROID_KEYSTORE_PATH`, `ANDROID_KEYSTORE_PASSWORD`,
|
||||
`ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`.
|
||||
|
||||
### 2. Build the bundle
|
||||
|
||||
```bash
|
||||
scripts/build-release-aab.sh <versionCode> <versionName>
|
||||
# composeApp/build/outputs/bundle/release/composeApp-release.aab
|
||||
```
|
||||
|
||||
The script verifies the signature and prints the SHA-256. Bump `versionCode` for
|
||||
every upload; `VERSION_CODE`/`VERSION_NAME` can also be set in the environment.
|
||||
|
||||
### 3. Upload
|
||||
|
||||
In Play Console: **Testing → Internal testing → Create new release → App
|
||||
integrity → Google-generated key**, upload the AAB, add release notes, then
|
||||
**Save → Roll out**. The first upload enrolls the app in Play App Signing. Share
|
||||
the opt-in link from the Testers tab with your test list.
|
||||
|
||||
### 4. Automated uploads (later)
|
||||
|
||||
Create a service account in Google Cloud, enable the **Google Play Android
|
||||
Developer API**, and grant the service account release permissions for this app
|
||||
in Play Console. Then wire Gradle Play Publisher with the service account JSON.
|
||||
The first AAB must still be uploaded manually.
|
||||
|
||||
## App state and offline behaviour
|
||||
|
||||
`AppStore` is a plain Kotlin class with a `StateFlow<AppState>`; Compose observes it. It owns:
|
||||
|
||||
- **Auth** — restore token, refresh token, logout.
|
||||
- **Auth** — restore the saved token on launch and log out.
|
||||
- **Library sync** — first launch pages through `/library/songs`; later launches use the `since` delta and tombstones. Songs are split into music and longform using the folders assigned at login, so the two never mix client-side.
|
||||
- **Mood cache** — mood details are stored so the app can open them offline.
|
||||
- **Radio** — one session per mood, batches of 12, prefetch when the queue is short, no repeats within a session.
|
||||
|
||||
Reference in new issue
Block a user