Repository navigation
Package the Android release bundle under the name React Native loads - #536
Merged
Merged
Conversation
The sample overrode `bundleAssetName` to `ReactNative.android.bundle`, but `MainApplication` uses the default React host, which loads `assets://index.android.bundle`. Release APKs built by Gradle therefore packed a bundle the app never reads. `scripts/release_android` masked this by writing `index.android.bundle` into `src/main/assets` before building. Use the React Native Gradle plugin default so Gradle-built release APKs contain the bundle the runtime expects.
kieran-osgood-shopify
marked this pull request as ready for review
October 1, 2026 10:11
kiftio
approved these changes
Oct 1, 2026
kieran-osgood-shopify
deleted the
fix/android-release-bundle-asset-name
branch
October 1, 2026 15:19
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.
What changes are you making?
Packages the sample's Android JavaScript bundle under the asset name React Native loads at runtime.
sample/android/app/build.gradleoverrodebundleAssetNametoReactNative.android.bundle.MainApplicationuses the default React host, which loadsassets://index.android.bundle(DefaultReactHostjsBundleAssetPath = "index",ReactNativeHost.getBundleAssetName()). A release APK built by Gradle therefore packed a bundle the app never reads.The mismatch dates from the repository reorganisation (#7). Two things hid it:
sample/scripts/release_androidwritesindex.android.bundleintosrc/main/assetsbefore building.This change drops the override back to the React Native Gradle plugin default,
index.android.bundle, so a Gradle-built release APK contains the bundle the runtime expects.Split out of the dependency sweep (#529) so it can be reviewed on its own.
How to test
GIVEN the sample has working test-store configuration in
sample/.envAND
sample/android/app/src/main/assetscontains no JavaScript bundleAND no Metro server is reachable from the device
WHEN you build with
cd sample/android && ./gradlew assembleRelease -PreactNativeArchitectures=arm64-v8aAND you sign
app/build/outputs/apk/release/app-release.apkwithapp/debug.keystore(apksigner sign --ks app/debug.keystore --ks-pass pass:android --key-pass pass:android --ks-key-alias androiddebugkey), install it, and launch the appTHEN the APK should contain
assets/index.android.bundleAND the app should load the catalog, add a product to the cart, and open checkout without a Metro connection
On
main, the same APK containsassets/ReactNative.android.bundleinstead, which the runtime does not load.PR Checklist
Important
Releasing a new version of the kit?
package.jsonfile.Tip
See the Contributing documentation for instructions on how to publish a new version of the library.