Repository navigation
fix(currency-math): pack the curve tables into the app again - #1908
Merged
Merged
Conversation
Moving :libs:currency-math onto the KMP android target in #1894 put the curve tables in src/androidMain/assets, but that target skips assets unless androidResources is enabled. Build 4969 shipped without discrete_pricing_table.bin and discrete_cumulative_table.bin, so the curve never initialized and every launch crashed on the first token balance with "DiscreteBondingCurve not initialized" (Bugsnag 6aadeebd). Enable androidResources for the module, and add a per-variant check<Variant>CurveAssets task that fails when either table is missing from the app's merged assets. flipcashTestDebug runs the debug check, and assembleRelease and bundleRelease depend on the release one, since the build itself succeeds without the tables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every launch of 2026.10.5 (4969) crashes with
DiscreteBondingCurve not initialized(Bugsnag 6aadeebd, 7 events in 3 minutes on 10-30). Production 2026.10.3 predates the cause and isn't affected.#1894 moved
:libs:currency-mathonto the KMP android target and its tables tosrc/androidMain/assets. That target skips res and assets unlessandroidResources { enable = true }is set, which the nine other KMP modules with Android resources already do. The 4969 AAB has nodiscrete_*.bin, soCurves.initializefails insidelaunchBestEffort, andTokenController.buildTokenWithBalancehitsDiscreteBondingCurve.getOrThrow().Changes:
androidResourcesinlibs/currency-math/build.gradle.kts. The debug APK now contains both tables.check<Variant>CurveAssetsin the app, which readsSingleArtifact.ASSETSand fails when a table is missing.flipcashTestDebugruns the debug check, so PR CI catches it;assembleReleaseandbundleReleasedepend on the release check. With the flag removed, the check fails and names both files.