diff --git a/BUILDING.md b/BUILDING.md index fd810b72..48e9bb6b 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1434,8 +1434,8 @@ The recommended way to build for Android is using the automated build script: ##### 1. Bump the version in package.json, then update these versions & run: ```bash -perl -p -i -e 's/versionCode .*/versionCode 72/g' android/app/build.gradle -perl -p -i -e 's/versionName .*/versionName "1.4.6"/g' android/app/build.gradle +perl -p -i -e 's/versionCode .*/versionCode 73/g' android/app/build.gradle +perl -p -i -e 's/versionName .*/versionName "1.4.7"/g' android/app/build.gradle ``` ##### 2. Build @@ -1446,13 +1446,13 @@ perl -p -i -e 's/versionName .*/versionName "1.4.6"/g' android/app/build.gradle npm run build:android:prod ``` -##### 3. Open the project in Android Studio +##### 2.1. (Optional) Open the project in Android Studio ```bash npx cap open android ``` -##### 4. Use Android Studio to build and run on emulator or device +##### 3. Use Android Studio to build and run on emulator or device #### Android Build from the console @@ -1460,13 +1460,7 @@ npx cap open android * Note that this currently fails: `./gradlew build` -To create the `aab` file, `bundle` instead of `build` (but not signed and not usable in Play Store): - -```bash -./gradlew bundleDebug -Dlint.baselines.continue=true -``` - -So, to create a signed `aab` release: +To create a signed `aab` release: - Setup by adding the app/gradle.properties.secrets file (see properties at top of app/build.gradle) and the app/time-safari-upload-key-pkcs12.jks file @@ -1479,6 +1473,12 @@ So, to create a signed `aab` release: ... and find your `aab` file at app/build/outputs/bundle/release +To create an unsigned debugging bundle (not usable in Play Store): + +```bash +./gradlew bundleDebug -Dlint.baselines.continue=true +``` + * Gradle packages whatever web bundle was last synced into `android/app/src/main/assets/public`, even one from a `--test` build. Before uploading, confirm it has production server defaults: diff --git a/README.md b/README.md index 8b4bb72b..ac475939 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,45 @@ npm run build:android:test:run Assumes ADB is installed; see [Android Build](BUILDING.md#android-build) for SDK, emulator, and `PATH` setup. +#### Building an APK for Android 6 (API 23) + +App versions up to 1.4.6 support Android 6.0 (API 23); later versions require Android 7.0 (API 24) or newer. To run the app on an Android 6 device, build your own APK from the 1.4.6 release commit (`6183afc2`, "bump version to 1.4.6"). + +Prerequisites: git, Node.js 20 (see `.nvmrc`), Java 21, and the Android SDK with `ANDROID_HOME` set (see [Android Emulator Without Android Studio](BUILDING.md#android-emulator-without-android-studio-command-line-only) for an SDK setup that skips Android Studio). With [pkgx](https://pkgx.dev), prefix the commands with `pkgx`, e.g. `pkgx npm ci`. + +1. Get the 1.4.6 source: + + ```bash + git clone https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa.git + cd crowd-funder-for-time-pwa + git checkout 6183afc2 + ``` + +2. Confirm the minimum SDK is 23: + + ```bash + grep minSdkVersion android/variables.gradle # expect: minSdkVersion = 23 + ``` + +3. Install dependencies and build a production APK: + + ```bash + npm ci + npm run build:android:prod -- --apk + ``` + + `npm ci` installs the exact dependency versions locked for 1.4.6. `build:android:prod -- --apk` builds the web app with production server settings, syncs it into the Android project, and runs `./gradlew assembleDebug`. The result is signed with your local Android debug key, so it installs on any device without a release keystore. + +4. Find the APK at `android/app/build/outputs/apk/debug/app-debug.apk` and install it, either with `adb install android/app/build/outputs/apk/debug/app-debug.apk` (USB debugging enabled on the phone) or by copying the file to the phone and opening it (allow "Install unknown apps" for the file manager). + +Notes: + +* **Back up your identity first.** A self-built APK has a different signature from the Play Store app, so Android refuses to install it over the store version. Uninstalling the store version deletes the app's local data, including your identifier keys. Back up your seed phrase (Profile page → "Backup Identifier Seed") before uninstalling, then import it into the self-built app. +* This build has Firebase disabled, so push notifications through Google's FCM service are off. +* The daily notification plugin calls `java.time`, which Android provides only from 8.0 (API 26). On Android 6, scheduling a daily reminder can crash the app; leave daily reminders off. See [doc/plugin-feedback-android-6-api23-zoneid-fix.md](doc/plugin-feedback-android-6-api23-zoneid-fix.md). +* Barcode scanning uses Google Play Services; on devices without them, scanning fails while the rest of the app works. +* A self-built APK does not auto-update. + ### iOS ```bash diff --git a/android/app/build.gradle b/android/app/build.gradle index 3fa73886..37d0a37e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -37,8 +37,8 @@ android { applicationId "app.timesafari.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 72 - versionName "1.4.6" + versionCode 73 + versionName "1.4.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/android/variables.gradle b/android/variables.gradle index 72549b4c..47a6dae2 100644 --- a/android/variables.gradle +++ b/android/variables.gradle @@ -1,5 +1,5 @@ ext { - minSdkVersion = 23 + minSdkVersion = 24 compileSdkVersion = 36 targetSdkVersion = 36 androidxActivityVersion = '1.8.0' diff --git a/package-lock.json b/package-lock.json index d2958241..fe8bc2a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "giftopia", - "version": "1.4.8-beta", + "version": "1.4.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "giftopia", - "version": "1.4.8-beta", + "version": "1.4.7", "dependencies": { "@capacitor-community/electron": "^5.0.1", "@capacitor-community/sqlite": "^7.0.3", diff --git a/package.json b/package.json index 198374e9..8bc63fd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "giftopia", - "version": "1.4.8-beta", + "version": "1.4.7", "description": "Giftopia App", "author": { "name": "Gift Economies Team"