From d86c14326c8d4b1b06af6019df6c7eaa92b8a68a Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Fri, 13 Nov 2026 13:13:12 -0800 Subject: [PATCH 1/7] build: upload an app bundle to Google Play instead of the apk Play rejected the 12.0.2 prod apk (347,174,595 bytes) as too large: it carries the native libraries for both ABIs, stored uncompressed. The publish lane now also builds bundleProdRelease, signed with the same injected key, and 'upload' sends wallet-prod-release.aab with the mapping. From a bundle, each device downloads only its own ABI. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 73a98d7caff838ec550e94cb3c1448ccadc703b3) --- fastlane/Fastfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 726ce4045c..112e965bf7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -115,9 +115,11 @@ platform :android do desc "Upload for pre-launch report" lane :upload do |options| - filename = "#{ENV['PWD']}/wallet/build/outputs/apk/prod/release/wallet-prod-release.apk" + # An app bundle, not the apk: Play rejects an apk this size (both ABIs' + # native libraries), while from a bundle each device downloads only its own ABI. + filename = "#{ENV['PWD']}/wallet/build/outputs/bundle/prodRelease/wallet-prod-release.aab" if !File.exist? "#{filename}" - UI.user_error!("Missing apk. Run 'publish' lane to build and upload") + UI.user_error!("Missing aab. Run 'publish' lane to build and upload") end mapping = "#{ENV['PWD']}/wallet/build/outputs/mapping/prodRelease/mapping.txt" @@ -125,7 +127,7 @@ platform :android do UI.user_error!("Missing mapping.txt. Run 'publish' lane to build and upload") end - supply(apk: filename, mapping: mapping, track: 'internal') + supply(aab: filename, mapping: mapping, track: 'internal') end desc "Promote to production track with 0.2 rollout by default" @@ -372,7 +374,8 @@ platform :android do end gradle( - task: "clean assembleProdRelease", + # The bundle is what 'upload' sends to Play; the apk is still built for checks. + task: "clean assembleProdRelease bundleProdRelease", properties: { "android.injected.signing.store.file" => "#{ENV['PWD']}/.deploy/dash-wallet.keystore", "android.injected.signing.store.password" => storepass, From d1908556feab6dc6f181377ad966d34fcc6e2c26 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Fri, 13 Nov 2026 13:38:54 -0800 Subject: [PATCH 2/7] build: produce the app bundle on the CI publish path too publish now asks build for the bundle, so the CI branch of build adds bundle when called from publish, and upload finds the .aab there as it does locally. CI Firebase distribution (build_distribute) still builds only the apk. Co-Authored-By: Claude Opus 5.5 --- fastlane/Fastfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 112e965bf7..e570531249 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -109,7 +109,8 @@ platform :android do UI.user_error!("SNAPSHOT dependencies found — remove before releasing:\n#{snapshot_hits.join("\n")}") end - build(options) + # 'upload' sends the app bundle, so the build must produce it on either path. + build(options.merge(bundle: true)) upload(options) end @@ -354,8 +355,11 @@ platform :android do type=options[:type].capitalize storepass=options[:storepass] versioncode=options[:versioncode] + task = "clean assemble#{flavor}#{type}" + # Only Play publishing needs the bundle; Firebase distribution uses the apk. + task += " bundle#{flavor}#{type}" if options[:bundle] gradle( - task: "clean assemble#{flavor}#{type}", + task: task, properties: { "android.injected.signing.store.file" => "#{ENV['PWD']}/.deploy/keystore.jks", "android.injected.signing.store.password" => storepass, From b1b3f32451679666d9a3cf99f3a9c4705232b2e0 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Fri, 13 Nov 2026 13:41:43 -0800 Subject: [PATCH 3/7] build: upload only the app bundle from the publish lane The build lane also produces the apk, and the gradle action leaves its path in the lane context, so supply received both the apk and the aab and refused ('Cannot provide both apk(s) and aab'). skip_upload_apk keeps the upload to the bundle. Co-Authored-By: Claude Opus 5.5 --- fastlane/Fastfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e570531249..13a5e0bc5f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -128,7 +128,9 @@ platform :android do UI.user_error!("Missing mapping.txt. Run 'publish' lane to build and upload") end - supply(aab: filename, mapping: mapping, track: 'internal') + # The build also leaves an apk in the lane context, which supply would pick + # up next to the aab and then refuse; upload only the bundle. + supply(aab: filename, mapping: mapping, track: 'internal', skip_upload_apk: true) end desc "Promote to production track with 0.2 rollout by default" From 1ca1525abfeff1366cab16de461ed7c2cb6043dd Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Fri, 13 Nov 2026 13:43:58 -0800 Subject: [PATCH 4/7] build: separate apk and aab lanes; publish builds the aab only build ('Build apk') builds the apk only again. The new build_aab lane ('Build aab') builds the app bundle only, on the local and CI paths. publish now runs build_aab then upload, so it no longer builds an apk it does not send. Co-Authored-By: Claude Opus 5.5 --- fastlane/Fastfile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 13a5e0bc5f..5c9686f5c0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -109,8 +109,8 @@ platform :android do UI.user_error!("SNAPSHOT dependencies found — remove before releasing:\n#{snapshot_hits.join("\n")}") end - # 'upload' sends the app bundle, so the build must produce it on either path. - build(options.merge(bundle: true)) + # 'upload' sends the app bundle, so publish builds the bundle only. + build_aab(options) upload(options) end @@ -128,8 +128,8 @@ platform :android do UI.user_error!("Missing mapping.txt. Run 'publish' lane to build and upload") end - # The build also leaves an apk in the lane context, which supply would pick - # up next to the aab and then refuse; upload only the bundle. + # Upload only the bundle: an apk built in the same run is left in the lane + # context, and supply refuses to send both. supply(aab: filename, mapping: mapping, track: 'internal', skip_upload_apk: true) end @@ -332,6 +332,9 @@ platform :android do desc "Build apk" lane :build do |options| + # bundle: true builds the app bundle (.aab) instead of the apk (see build_aab). + verb = options[:bundle] ? "bundle" : "assemble" + # Strip PiggyCards test merchants from production release builds. ENV['BUILD_PROD'] = '1' @@ -357,11 +360,8 @@ platform :android do type=options[:type].capitalize storepass=options[:storepass] versioncode=options[:versioncode] - task = "clean assemble#{flavor}#{type}" - # Only Play publishing needs the bundle; Firebase distribution uses the apk. - task += " bundle#{flavor}#{type}" if options[:bundle] gradle( - task: task, + task: "clean #{verb}#{flavor}#{type}", properties: { "android.injected.signing.store.file" => "#{ENV['PWD']}/.deploy/keystore.jks", "android.injected.signing.store.password" => storepass, @@ -380,8 +380,7 @@ platform :android do end gradle( - # The bundle is what 'upload' sends to Play; the apk is still built for checks. - task: "clean assembleProdRelease bundleProdRelease", + task: "clean #{verb}ProdRelease", properties: { "android.injected.signing.store.file" => "#{ENV['PWD']}/.deploy/dash-wallet.keystore", "android.injected.signing.store.password" => storepass, @@ -393,6 +392,11 @@ platform :android do end end + desc "Build aab" + lane :build_aab do |options| + build(options.merge(bundle: true)) + end + desc "Download explore.db" lane :explore_db do |options| assets_path = "#{ENV['PWD']}/wallet/assets/" From 49004aecddad7b89a3242fc6d565588a7255550b Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Fri, 13 Nov 2026 13:48:23 -0800 Subject: [PATCH 5/7] docs: document build_aab and the .aab upload for Google Play Co-Authored-By: Claude Opus 5.5 --- wallet/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wallet/README.md b/wallet/README.md index f661808709..ec86a26d52 100644 --- a/wallet/README.md +++ b/wallet/README.md @@ -197,11 +197,17 @@ The APK is placed here: `wallet/build/outputs/apk/wallet-prod-release.apk` ```sh fastlane build storepass:[keystore password] keypass:[key password] ``` -## Upload existing wallet-prod-release.apk file to the internal test track. +## Build the app bundle for Google Play +Google Play takes the app bundle, not the APK. The bundle is placed here: +`wallet/build/outputs/bundle/prodRelease/wallet-prod-release.aab` +```sh + fastlane build_aab storepass:[keystore password] keypass:[key password] +``` +## Upload existing wallet-prod-release.aab file to the internal test track. ```shell fastlane upload ``` -## Build, followed by Upload +## Build the app bundle, followed by Upload ```shell fastlane publish storepass:[keystore password] keypass:[key password] ``` From e5fc083200f44791ea01aa1f513faccd17ad2875 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Sat, 14 Nov 2026 09:30:05 -0800 Subject: [PATCH 6/7] build: keep the Gradle variant spelling on the CI build path capitalize lowercased the rest of the flavor, so _testNet3 became _testnet3 in the task name. Use the existing gradle_flavor and gradle_type helpers, which only raise the first letter. Co-Authored-By: Claude Opus 5.5 --- fastlane/Fastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5c9686f5c0..ee0ac42fcd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -356,8 +356,8 @@ platform :android do end if is_ci - flavor=options[:flavor].capitalize - type=options[:type].capitalize + flavor = gradle_flavor(options[:flavor].to_s) + type = gradle_type(options[:type].to_s) storepass=options[:storepass] versioncode=options[:versioncode] gradle( From 4a7d76012fc30846dc039afd6724c5f9c365e563 Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Sat, 14 Nov 2026 17:01:59 -0800 Subject: [PATCH 7/7] build: skip comment lines in the publish lane's SNAPSHOT check A comment in wallet/build.gradle names a SNAPSHOT version, so the check stopped publish before it built the bundle. Only a declaration is a hit. Co-Authored-By: Claude Opus 5.5 --- fastlane/Fastfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index ee0ac42fcd..85d1db6a46 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -102,6 +102,8 @@ platform :android do Dir.glob("#{ENV['PWD']}/**/*.{gradle,gradle.kts,toml}").each do |f| next if f.include?("/build/") || f.include?("/.gradle/") File.readlines(f).each_with_index do |line, idx| + # Comments can name a SNAPSHOT version; only a declaration is a hit. + next if line.lstrip.start_with?("//", "/*", "*", "#") snapshot_hits << "#{f}:#{idx + 1}: #{line.strip}" if line.include?("SNAPSHOT") end end