Repository navigation
Description
Mapbox Version
11.33.0 (default)
React Native Version
0.84.1
Platform
Android
@rnmapbox/maps version
main (8642d97), 10.3.16
Standalone component to reproduce
import React from 'react';
import {
MapView,
Camera,
LocationPuck,
Models,
ModelLayer,
ShapeSource,
} from '@rnmapbox/maps';
const center = [-71.1, 42.34];
const car = require('./assets/sportcar.glb');
export default function BugReportExample() {
return (
<MapView style={{ flex: 1 }}>
<Camera centerCoordinate={center} zoomLevel={18} pitch={50} />
<LocationPuck model={{ uri: car, scale: [40, 40, 40] }} />
<Models models={{ car }} />
<ShapeSource id="src" shape={{ type: 'Point', coordinates: center }}>
<ModelLayer id="layer" style={{ modelId: 'car', modelScale: [10, 10, 10] }} />
</ShapeSource>
</MapView>
);
}Any .glb works; the example app's example/src/assets/sportcar.glb was used (glb is already in the example's Metro assetExts). The Location Puck 3D and Simple Model Layer examples show the same thing in a Release build.
Observed behavior and steps to reproduce
- Build the app in Release (
./gradlew assembleRelease) and run it on an Android device/emulator (tested on an Android 14 arm64 emulator). - The 3D model never appears, neither for
LocationPucknor forModelLayer. Logcat shows:
E/Mapbox (30250): [maps-core]: Unknown model file type: src_assets_sportcar
In a Debug build served by Metro both render fine. Using an asset:// URL also works in Release (copy the file to android/app/src/main/assets/ and pass uri: 'asset://sportcar.glb' / models={{ car: 'asset://sportcar.glb' }}), which is the workaround for now.
Expected behavior
A model given with require(...) renders in Release just like in Debug.
Notes / preliminary analysis
In Release, React Native bundles non-image assets into res/raw, and Image.resolveAssetSource on Android returns only the resource name (src_assets_sportcar, no scheme, no extension). Both RNMBXNativeUserLocation.makeLocationPuck3D and RNMBXModels hand that string to Mapbox unchanged, and Mapbox can neither read raw resources nor guess the model format without an extension.
iOS should not be affected: there resolveAssetSource returns a file:// URL into the app bundle that keeps the .glb extension.
Additional links and references
Found while testing #4432.
Activity
github-actions commentedon Nov 4, 2026
Lint failed 😭
Please fix the errors in your code example - More info.:
fix(android): load require()'d 3D models in release builds
fix(android): load require()'d 3D models in release builds (#4434)