map-ir / mapir-react-native-sdk

MIT License
14 stars 3 forks source link

Crash app #25

Open sajadspeed opened 3 years ago

sajadspeed commented 3 years ago

I following your documentation but android app not run and crash.

App.js

import React from 'react';
import { SafeAreaView, StyleSheet, View} from 'react-native';
import Mapir from 'mapir-react-native-sdk'

const App = () => {

    return (
        <SafeAreaView style={styles.container}>
            <View style={styles.container}>
                <Mapir
                apiKey={'****'}
                onRegionDidChange={(e) => onRegionDidChange(e)}
                style={styles.container}
                >
                <Mapir.Camera
                    zoomLevel={13}
                    centerCoordinate={[51.422548, 35.732573]}
                />
                </Mapir>
            </View>
        </SafeAreaView>
    );
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
});

export default App;
sajadspeed commented 3 years ago

Also some warnings show to me:

 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
 WARN  `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
ReyhaneMasumi commented 3 years ago

As mentioned in docs, this SDK supports RN < 0.62.2. So there is the possibility of errors for other versions. However, you can check the logcat in Android Studio to find out the reason for crashing!