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

fix(android): fix crash calling clearData #3661

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Conversation

mfazekas
Copy link
Contributor

Description

Android crashes when calling .clearData() on v10

2024-10-20 16:41:04.051 17011-17011 System.err              com.rnmapboxglexample                W  java.lang.RuntimeException: Cannot convert argument of type class com.mapbox.bindgen.None
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.facebook.react.bridge.Arguments.fromJavaArgs(Arguments.java:191)
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:31)
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.facebook.react.bridge.PromiseImpl.resolve(PromiseImpl.java:60)
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.rnmapbox.rnmbx.modules.RNMBXModule$clearData$1$1.invoke(RNMBXModule.kt:140)
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.rnmapbox.rnmbx.modules.RNMBXModule$clearData$1$1.invoke(RNMBXModule.kt:138)
2024-10-20 16:41:04.053 17011-17011 System.err              com.rnmapboxglexample                W  	at com.rnmapbox.rnmbx.v11compat.mapboxmap.MapboxMapKt.clearData$lambda$2(MapboxMap.kt:41)

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Component to reproduce the issue you're fixing

import React from 'react';
import Mapbox, { MapView, Camera } from '@rnmapbox/maps';
import { View, Button, Text, TouchableOpacity } from 'react-native';

export default function DebugScreen() {
  return (
    <View style={{ flex: 1 }}>
      <Button title="Clear Data" onPress={() => Mapbox.clearData()} />
      <MapView style={{ flex: 1 }}>
        <Camera
          defaultSettings={{
            centerCoordinate: [-87.622088, 41.878781],
            zoomLevel: 10,
          }}
        />
      </MapView>
    </View>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant