fix(android): support unstable_path query param in asset URLs (#55072)

Summary:
Syncs `getAndroidResourceIdentifier` implementations between [`/community-cli-plugin/src/commands/bundle/assetPathUtils.js`](https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/bundle/assetPathUtils.js#L72-L79) and [`/assets/path-support.js`](https://github.com/facebook/react-native/blob/main/packages/assets/path-support.js#L77-L85).

Ideally, the former should use `react-native/assets-registry` directly so we don't need to sync.

## Changelog:

[ANDROID] [FIXED] - Handle `unstable_path` query param in asset URLs

Pull Request resolved: https://github.com/facebook/react-native/pull/55072

Test Plan: n/a

Reviewed By: javache

Differential Revision: D90267467

Pulled By: Abbondanzo

fbshipit-source-id: f4eb0053c6af02b67f3fb493ae76e290d6b354e5
This commit is contained in:
Tommy Nguyen authored and React Native Bot committed 2026-02-03 13:43:03 +00:00
1 parent c931fa81e7
commit d9d2c67ae4
1 file changed
+1 -1
@@ -73,7 +73,7 @@ function getResourceIdentifier(asset: PackagerAsset): string {
.toLowerCase()
.replace(/\//g, '_') // Encode folder structure in file name
.replace(/([^a-z0-9_])/g, '') // Remove illegal chars
.replace(/^assets_/, ''); // Remove "assets_" prefix
.replace(/^(?:assets|assetsunstable_path)_/, ''); // Remove "assets_" or "assetsunstable_path_" prefix
}
function getBasePath(asset: PackagerAsset): string {