@oxy.so/app-preset 6.1.0 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -186,7 +186,7 @@ bump it for a native change and the next push to main releases a new binary
186
186
  (oxy's `android-release.yml`, docs/engineering/build-and-deploy.md#native-android-releases);
187
187
  a JS-only change keeps the version and ships as an OTA update.
188
188
 
189
- #### One APK per ABI (always on, 6.1.0+)
189
+ #### One APK per ABI (always on, 6.1.1+)
190
190
 
191
191
  `withOxyAbiSplits`, applied by the preset and by `withOxyUpdates`, adds Gradle
192
192
  ABI splits to `android/app/build.gradle`, so `assembleRelease` writes one APK per
@@ -202,6 +202,15 @@ A universal APK carries every ABI's native libraries and a phone loads one
202
202
  `bundleRelease` is unaffected: the AAB keeps every ABI and Google Play serves
203
203
  each device its slice.
204
204
 
205
+ Build the AAB and the APKs in **two Gradle invocations**
206
+ (`./gradlew :app:bundleRelease`, then `./gradlew :app:assembleRelease`). When R8
207
+ shrinks resources, AGP fails a build that makes split APKs next to an app bundle
208
+ ("Multiple shrunk-resources files found … Please disable building multiple APKs
209
+ when building an Android app bundle",
210
+ [issuetracker 402800800](https://issuetracker.google.com/402800800)), so the
211
+ splits are off in any invocation that builds a bundle, and that invocation's
212
+ `assembleRelease` gives a universal APK.
213
+
205
214
  A build that compiles none of those ABIs splits to the ones it compiles, so
206
215
  `expo run:android` on an x86_64 emulator (it passes
207
216
  `-PreactNativeArchitectures=x86_64`) still gets `app-x86_64-debug.apk`, which the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/app-preset",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "The Oxy distro of Expo — centralized Expo config plugin, Metro/Babel/ESLint factories, Tailwind base CSS and TypeScript bases shared by every Oxy app (Mention, Homiio, Allo, accounts, …). A zero-build package: apps replace copy-pasted config with a single dependency bump.",
5
5
  "main": "./app.plugin.js",
6
6
  "publishConfig": {
@@ -13,6 +13,15 @@
13
13
  * still builds one AAB with every ABI, and Google Play serves each device its
14
14
  * own slice of it.
15
15
  *
16
+ * The splits are OFF in a Gradle invocation that builds a bundle. When R8
17
+ * shrinks resources (`shrinkResources`, which every Oxy release does), AGP
18
+ * fails `buildReleasePreBundle` with "Multiple shrunk-resources files found …
19
+ * Please disable building multiple APKs when building an Android app bundle"
20
+ * (https://issuetracker.google.com/402800800). So the AAB and the APKs are
21
+ * two invocations, `./gradlew :app:bundleRelease` then
22
+ * `./gradlew :app:assembleRelease`; one invocation asking for both builds a
23
+ * universal APK, which Oxy's release workflow refuses.
24
+ *
16
25
  * A build for ONE device keeps working: `expo run:android` passes
17
26
  * `-PreactNativeArchitectures=<the device's ABI>` for a debug build, so the
18
27
  * split follows the ABIs Gradle compiles whenever none of the release ABIs is
@@ -47,16 +56,20 @@ const RESOLVE_ABIS = `// ${MARKER}: one APK per ABI, no universal APK (@oxy.so/a
47
56
  def oxyBuiltAbis = (findProperty('reactNativeArchitectures') ?: 'armeabi-v7a,arm64-v8a,x86,x86_64').toString().split(',').collect { it.trim() }.findAll { it }
48
57
  def oxyReleaseAbis = [${RELEASE_ABIS.map((abi) => `'${abi}'`).join(', ')}].findAll { oxyBuiltAbis.contains(it) }
49
58
  def oxyApkAbis = oxyReleaseAbis ?: oxyBuiltAbis
59
+ // AGP refuses ABI splits in an invocation that also builds an app bundle while R8 shrinks
60
+ // resources (https://issuetracker.google.com/402800800), and a bundle never uses them: build
61
+ // the AAB and the APKs in two invocations.
62
+ def oxyBuildsBundle = gradle.startParameter.taskNames.any { it.tokenize(':').last().toLowerCase().startsWith('bundle') }
50
63
 
51
64
  `;
52
65
 
53
66
  /** Inserted as the first entry of `android {`. */
54
67
  const SPLITS = `
55
- // ${MARKER}: the APKs are oxyApkAbis, one each; the AAB is unaffected.
68
+ // ${MARKER}: the APKs are oxyApkAbis, one each; off while building a bundle.
56
69
  splits {
57
70
  abi {
58
71
  reset()
59
- enable true
72
+ enable !oxyBuildsBundle
60
73
  universalApk false
61
74
  include(*oxyApkAbis)
62
75
  }