react-native-mapbox-gl icon indicating copy to clipboard operation
react-native-mapbox-gl copied to clipboard

IllegalArgumentException crash on Android

Open hannta opened this issue 6 years ago • 37 comments

Im seeing several following crashes on Google Play console.

java.lang.IllegalArgumentException: 
  at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onSurfaceChanged (MapRenderer.java:67)
  at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewMapRenderer.onSurfaceChanged (TextureViewMapRenderer.java:48)
  at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewRenderThread.run (TextureViewRenderThread.java:269)

react-native-mapbox-gl: 6.1.0 react-native: 0.52.2 device: android

hannta avatar Mar 12 '18 07:03 hannta

This is our number one crash at the moment :(

henrikra avatar Mar 15 '18 11:03 henrikra

@nitaliano do you have any ideas about this?

hannta avatar Mar 16 '18 11:03 hannta

@nitaliano we are having tons of this crash 💣 Do you have an idea for this? 💡

henrikra avatar Mar 28 '18 06:03 henrikra

Is there anymore information on this or do you know how to reproduce this?

nitaliano avatar Mar 28 '18 14:03 nitaliano

This can only occur as part of the onSurfaceChanged callback. We haven't had reports of this issue upstream in gl-native. @hannta / @henrikra , do you see any additional error message to this IllegalArgumentException? eg. fbWidth cannot be negative. or fbWidth cannot be greater than 65535. I will create an issue upstream and link it back here, any additional information would be highly appreciated!

tobrun avatar Mar 28 '18 18:03 tobrun

Yeah the logs say fbWidth cannot be negative

java.lang.IllegalArgumentException fbWidth cannot be negative. 
    MapRenderer.java:67 com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onSurfaceChanged
    TextureViewMapRenderer.java:48 com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewMapRenderer.onSurfaceChanged
    TextureViewRenderThread.java:269 com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewRenderThread.run

Does this help you?

henrikra avatar Mar 28 '18 19:03 henrikra

@henrikra yes it does, just for reference we opened an issue in gl-native as well https://github.com/mapbox/mapbox-gl-native/issues/11549

nitaliano avatar Mar 28 '18 19:03 nitaliano

Any updates on this?

Rnorback avatar Apr 03 '18 20:04 Rnorback

@kmagiera can you make a PR with that fix?

nitaliano avatar Apr 07 '18 18:04 nitaliano

@nitaliano since we only have seen this crash occurring on react-native, I would prefer patching this up in this repo instead of on upstream. Thoughts?

tobrun avatar Apr 13 '18 14:04 tobrun

@tobrun yes I agree with this, and I think we have a path forward for a patch

nitaliano avatar Apr 13 '18 17:04 nitaliano

Still number one crash at the moment. Is somebody working on this who knows the codebase? :)

henrikra avatar Apr 16 '18 07:04 henrikra

Here is a PR https://github.com/mapbox/react-native-mapbox-gl/pull/1171 with a potential fix, I cannot reproduce this issue, so if someone could test this out and let me know if this fixes their issue that would be great

nitaliano avatar Apr 16 '18 19:04 nitaliano

@nitaliano @henrikra We're experiencing this issue widely as well. Is it worth making a new release with 6.1.2-beta? Will that fix the problem? Have not been able to reproduce the issue locally, have just indirectly seen this reported from our production application.

nlindroos avatar Jun 26 '18 07:06 nlindroos

@nitaliano This should be open. We are still getting this

henrikra avatar Jul 02 '18 07:07 henrikra

@henrikra did you give 6.1.2-beta a try?

nitaliano avatar Jul 02 '18 18:07 nitaliano

@nitaliano Yeah we tried it in April and it was totally broken :/ Crashes and freezes. That version cannot be used in production

henrikra avatar Jul 03 '18 06:07 henrikra

Some of our users also have this issue (20 out or 100 000 but it happens). HEre is the stacktrace:

java.lang.IllegalArgumentException: fbWidth cannot be negative.
    at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onSurfaceChanged(MapRenderer.java:67)
    at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewMapRenderer.onSurfaceChanged(TextureViewMapRenderer.java:48)
    at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewRenderThread.run(TextureViewRenderThread.java:269)

The last occurence is 4 days ago with the last stable version of the package. So I think the patch isn't really working. :confused:

Gp2mv3 avatar Jul 09 '18 08:07 Gp2mv3

Any updates for this issue? I am also getting java.lang.IllegalArgumentException: fbHeight cannot be greater than 65535. at com.mapbox.mapboxsdk.maps.renderer.MapRenderer.onSurfaceChanged(MapRenderer.java:80) at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewMapRenderer.onSurfaceChanged(TextureViewMapRenderer.java:48) at com.mapbox.mapboxsdk.maps.renderer.textureview.TextureViewRenderThread.run(TextureViewRenderThread.java:269) But this is only on Android. It works fine on iOS.

I got it resolved. I had it set to height='100%' earlier which made it grow in the height. Now I am handling height of the container from the Android and setting height='100%' in the RN works.

HarshalIndiJoshi avatar Jul 23 '18 23:07 HarshalIndiJoshi

@HarshalIndiJoshi Are you saying that you know how to reproduce this issue? What would the steps be in that case? Could you describe how you solved it in more detail? Thanks!

nlindroos avatar Aug 06 '18 09:08 nlindroos

<TouchableOpacity style={{ width: '100%', height: 230 }} activeOpacity={1.0} > <Mapbox.MapView styleURL={Mapbox.StyleURL.Street} zoomLevel={10} centerCoordinate={[ Number(this.props.longitude), Number(this.props.latitude) ]} style={styles.container} zoomEnabled={false} pitchEnabled={false} scrollEnabled={false} rotateEnabled={false} showUserLocation={true}> </Mapbox.MapView> </TouchableOpacity>

If you look at the code then you will notice that height is given a specific value and not 100%. I had seen the issue on android when I had set height:100%. In iOS integration height:100% worked but I guess it's not same case for Android. I am new to android and react-native both. So please excuse me if I am giving any non-relevant information here. Again, I am not saying that this is THE SOLUTION. But it WORKED FOR ME. I can reproduce the issue by setting height:100%

HarshalIndiJoshi avatar Aug 08 '18 17:08 HarshalIndiJoshi

This started happening in the latest release of our app. Among other things we updated react native (0.55.3 -> 0.56.0). The crash is most common with Android 8.0 users, but also affects 8.1, 7.0, 6.0. The release is on 6.1.1; we'll hopefully release a new version with 6.1.3 next week - crossing my fingers that the issue disappears.

badrange avatar Sep 07 '18 08:09 badrange

Sorry: I'd like to take the comment above back - we HAVE seen this before, just with a different signature so the crashlogs showed up as new in Google Play Console. Here's to hoping that 6.1.3 resolves it for us.

badrange avatar Sep 07 '18 10:09 badrange

@badrange Keep us in touch 🤞

tlenclos avatar Sep 07 '18 12:09 tlenclos

@badrange any news ? Just to know if I should update. Thanks :)

tlenclos avatar Sep 17 '18 08:09 tlenclos

Release is a bit delayed, hoping that it goes out the door some time this week. I think you should update in any case! :-)

badrange avatar Sep 17 '18 08:09 badrange

Update: We finally published the new version yesterday. So far we have received 26 crash reports - Android 6, 7, 8 and 8.1 - a range of phone models from Samsung, Motorola, Huawei and Nokia.

[email protected] [email protected]

badrange avatar Sep 28 '18 07:09 badrange

Im seeing pretty similar figures on our app, crashes on android... 😟

[email protected] [email protected]

hannta avatar Sep 28 '18 08:09 hannta

I get the same error.. "@mapbox/react-native-mapbox-gl": "^6.1.3" "react-native": "0.57.0"

LaunchingDream avatar Nov 02 '18 05:11 LaunchingDream

Reports Last 7 days: 1,072

badrange avatar Dec 18 '18 12:12 badrange