Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghadeeraqraa1992 opened this issue Apr 15, 2021 · 6 comments
Labels
wontfix This will not be worked on

Comments

@ghadeeraqraa1992
Copy link

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
Screen Shot 2021-04-15 at 9 58 42 AM

Versions (please complete the following information):

  • Platform: Android
  • Platform OS: Android 11
  • Device: SM-N975U
  • Emulator/ Simulator: no
  • Dev OS: production version from google store
  • @react-native-mapbox-gl/maps Version : ^8.0.0
  • @mapbox/mapbox-sdk: ^0.10.0
  • React Native Version: 0.63.4
@ghadeeraqraa1992
Copy link
Author

any update , it is a production issue

@ferdicus
Copy link
Member

I'm curious: What makes you think that this is related to this repo?
I can't see any mention of mapbox in the call stack.

Not saying, that it isn't related, just want to know what makes you think it is?

@ferdicus
Copy link
Member

ferdicus commented Apr 20, 2021

For reference: facebook/react-native#17530

@ghadeeraqraa1992
Copy link
Author

I'm curious: What makes you think that this is related to this repo?
I can't see any mention of mapbox in the call stack.

Not saying, that it isn't related, just want to know what makes you think it is?

as I see on sentry dashboard the issue appears after draw the route on the mapbox

@ferdicus
Copy link
Member

I'm curious: What makes you think that this is related to this repo?
I can't see any mention of mapbox in the call stack.
Not saying, that it isn't related, just want to know what makes you think it is?

as I see on sentry dashboard the issue appears after draw the route on the mapbox

Could you please try to set up a test-case with the example/BugReportExample that is causing this.
That way we could try to reproduce this.

Thanks

@stale
Copy link

stale bot commented Jun 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 20, 2021
@stale stale bot closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants