react-native-mapbox-gl
react-native-mapbox-gl copied to clipboard
onSnapshotReady crash on Android 8.1 / 9.0 with master
Project is Expo detached. We switched package.json to point to master, and when we call snapshot manager in a release build (works fine in dev mode) it produces this crash:
Android: 8.1.0 (also 9) Android Build: OPM7.181205.001 Manufacturer: Huawei Model: Nexus 6P (also Pixel 3) Thread: main-2
java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile(File.java:1976) at com.mapbox.rctmgl.c.a.a(BitmapUtils.java:69) at com.mapbox.rctmgl.modules.RCTMGLSnapshotModule$1$1.onSnapshotReady(RCTMGLSnapshotModule.java:82) at com.mapbox.mapboxsdk.snapshotter.MapSnapshotter$1.run(MapSnapshotter.java:438) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
We have writeToDisk: true
for Mapbox.snapshotManager.takeSnap()
- manifest has read/write storage permissions.
Flow to repro this:
- launch app
- grant Location permissions
- kill app
- start app and go to screen which uses takeSnap()
- will crash every time screen is visited
related to #1546
TIA
Just to try to isolate root cause, can you run the example project on the same device to identify if this is an expo-related issue or not?
@kristfal setting writeToDisk: false
is a workaround, did not have a chance to run the example project
@mutablestudio do you know where I can set writeToDisk to false? I have a same problem , it cause android crash
@Jackyaung where you call Mapbox.snapshotManager.takeSnap()
, pass in writeToDisk: false,
as one of the props
This is still an issue. writeToDisk: false does not solve the issue. Any other solution?