java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference #1313
Labels
wontfix
This will not be worked on
Describe the bug
in android production app (google store version) , we have NullPointerException Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)' on a null object reference
To Reproduce
1- get routeshape from the waypoints using the below code :
const getDirecction = async () => { const waypoints = sortedRoutePoints.map(point => { return {coordinates: [point.longitude, point.latitude]}; }); const {body: directions} = await directionsClient .getDirections({ profile: 'driving', geometries: 'geojson', waypoints: waypoints, }) .send(); if (directions.code == 'NoRoute') { return; } const route = directions.routes[0]; route && route.geometry && setRouteShape(turf.feature(route.geometry)); mapRef.current.fitToCoordinates(sortedRoutePoints); };
2- draw routeshape using the below component
<MapboxGL.ShapeSource id="routeSource" shape={routeShape}> <MapboxGL.LineLayer // belowLayerID="poiLayer" layerIndex={20} id="routeFill" style={{ lineColor: '#13f4ae', lineWidth: 5, }} /> </MapboxGL.ShapeSource>
Expected behavior
show the route "route shape" on the map
Actual behavior
null pointer exception
Screenshots
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: