lovebing / react-native-baidu-map

Baidu Map SDK modules and views for React Native(Android & iOS), support react native 0.61+. 百度地图 React Native 模块,支持 react native 0.61+,已更新到最新的百度地图SDK版本。
MIT License
847 stars 322 forks source link

BaiduMapView was not found in the UIManager in React native #252

Open nawnoes opened 5 years ago

nawnoes commented 5 years ago

hello everyone. I just want to use 'react-native-baidu-map' in react-native with expo. I installed this module using 'yarn add react-native-baidu-map'. and I added this code in my program.

So, please help me this issue.

thanks, have a good day

image

/**

import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View, Dimensions, Button} from 'react-native'; import { MapView, MapTypes, Geolocation, Overlay } from 'react-native-baidu-map'; const {height, width} = Dimensions.get('window');

type Props = {}; export default class App extends Component { state = { };

render() { const { infoWindowProps } = this.state; console.warn('Overlay', Overlay) return (

);

} }

const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', } });

KingAmo commented 5 years ago

the same error , any solution?

nawnoes commented 5 years ago

sorry, I'm foreigner. So I can't regist baidu developer. Our team decieded that our app don't use baidu-map.

I think you need expo eject or creat react-native app.

Im sorry not to help you. have a good day

2019년 6월 11일 (화) 오후 2:18, 秦帅 notifications@github.com님이 작성:

the same error , any solution?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lovebing/react-native-baidu-map/issues/252?email_source=notifications&email_token=AHUMRVMNZGJ5FF3OC3ZSNP3PZ4YTNA5CNFSM4HOKODN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXL63VI#issuecomment-500690389, or mute the thread https://github.com/notifications/unsubscribe-auth/AHUMRVP7GN3DFHJBUKHCEALPZ4YTNANCNFSM4HOKODNQ .

KingAmo commented 5 years ago

@nawnoes thank you anyway,totally in a mess today :(

Gusabary commented 5 years ago

同问这个bug咋解决(感激不尽

guohuihot commented 5 years ago

同问

Gusabary commented 5 years ago

解决方法:在 BaiduMapPackage.java 文件中把

@MainThread
protected void init(ReactApplicationContext reactContext) {
    Looper.prepare();
    SDKInitializer.initialize(reactContext.getApplicationContext());
}

修改成

@MainThread
protected void init(ReactApplicationContext reactContext) {
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    SDKInitializer.initialize(reactContext.getApplicationContext());
}

加一行判断就行了@guohuihot

StoneMancz commented 4 years ago

BaiduMapPackage.java 文件在哪

steele-cjf commented 4 years ago

@Gusabary 这个 BaiduMapPackage.java 文件在哪里?

zjafei commented 4 years ago

@Gusabary 这个 BaiduMapPackage.java 文件在哪里?

\node_modules\react-native-baidu-map\android\src\main\java\org\lovebing\reactnative\baidumap

Janeweet commented 1 year ago

新下载的react-native-baidu-map:1.0.37 已经有这行判断了,还是出现Invariant Violation: requireNativeComponent: "BaiduMapOverlayInfoWindow" was not found in the UIManager.

Luminaryyi commented 3 weeks ago

新下载的react-native-baidu-map:1.0.37 已经有这行判断了,还是出现Invariant Violation: requireNativeComponent: "BaiduMapOverlayInfoWindow" was not found in the UIManager.

我也出现这个问题了,请问你解决了吗