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
856 stars 322 forks source link

RCTBaiduMapViewManager.h文件找不到(1.0.6 版本 ) #226

Open XinQiXiao opened 5 years ago

XinQiXiao commented 5 years ago

(最近更新此组件,开发中遇到一些问题,一些资源方法与大家分享) 开发环境 node:v8.10.0 react: 16.6.3 react-native: 0.57.8 react-native-baidu-map: 1.0.6

iOS/xcode pod 导入成功,打开工程后 RCTBaiduMapViewManager.h 找不到时, 在 APPDelegate.m 文件,引入(一些code 如下)

import <react-native-baidu-map/BaiduMapViewManager.h>

... // 地图 ak 注册 [BaiduMapViewManager initSDK:@""]; ...

补充 CocoaPods有关补充 git url: https://github.com/CocoaPods/CocoaPods 官网:https://guides.cocoapods.org

使用 gem 升级 cocoapods 遇到问题,参考url:https://yq.aliyun.com/articles/652635

duanzjun commented 5 years ago

请问怎么用pod导入,我在ios目录下添加podfile文件,内容如下 `pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'CxxBridge', 'DevSupport', 'RCTText', 'RCTNetwork', 'RCTWebSocket', 'RCTAnimation' ] pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-baidu-map', :podspec => '../node_modules/react-native-baidu-map/ios/react-native-baidu-map.podspec'`

### 运行pod install 报如下错误

!] The dependencyReact/Core (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/CxxBridge (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/DevSupport (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/RCTText (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/RCTNetwork (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/RCTWebSocket (from ../node_modules/react-native)is not used in any concrete target. The dependencyReact/RCTAnimation (from ../node_modules/react-native)is not used in any concrete target. The dependencyyoga (from ../node_modules/react-native/ReactCommon/yoga)is not used in any concrete target. The dependencyDoubleConversion (from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec)is not used in any concrete target. The dependencyglog (from ../node_modules/react-native/third-party-podspecs/glog.podspec)is not used in any concrete target. The dependencyFolly (from ../node_modules/react-native/third-party-podspecs/Folly.podspec)is not used in any concrete target. The dependencyreact-native-baidu-map (from ../node_modules/react-native-baidu-map/ios/react-native-baidu-map.podspec)is not used in any concrete target.

XinQiXiao commented 5 years ago

缺乏工程 target,需要在 pod * 前加 target "工程名字" do

我的 podfile 文件内容如下(作为参考)

platform :ios, '9.0'

target '(工程名)' do pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'CxxBridge', 'DevSupport', 'RCTText', 'RCTNetwork', 'RCTWebSocket', 'RCTAnimation' ] pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-baidu-map', :podspec => '../node_modules/react-native-baidu-map/ios/react-native-baidu-map.podspec'

pod 'react-native-webview', :path => '../node_modules/react-native-webview'

end

cnpmge commented 5 years ago

你好,我导入的是android,link的,但是报Invariant Violation: Invariant Violation: requireNativeComponent: "BaiduMapView" was not found in the UIManager. 请问您是怎么解决的呢?

XinQiXiao commented 5 years ago

这个我还没遇到过。我这边执行react native link 就成功了。

cnpmge commented 5 years ago

这个我还没遇到过。我这边执行反应原生链接就成功了。

请问你用的RN是哪个版本?react-native-baidu-map用的是哪个版本??

XinQiXiao commented 5 years ago

node:v8.10.0 react: 16.6.3 react-native: 0.57.8 react-native-baidu-map: 1.0.6

cnpmge commented 5 years ago

节点:v8.10.0 react :16.6.3 react -native:0.57.8 react-native-baidu-map:1.0.6

是直接link的吗,在AndroidManifest.xml里应该配置了百度的sdk吧,然后就可以直接运行了?

XinQiXiao commented 5 years ago

直接link的。

cnpmge commented 5 years ago

直接link的。

非常感谢

CreateByCool commented 5 years ago

按照你的修改后,出现BaiduMapView does not exit的bug,请问是怎么解决的

milobluebell commented 5 years ago

这个项目是多久没维护了? 这么多开着的issue。。。

superzhy commented 5 years ago

请问这个问题解决没,同样是遇到这个问题 RCTBaiduMapViewManager.h文件找不到 image

KingAmo commented 5 years ago

@superzhy 老哥你解决这个问题没?同样遇到这个问题了。。。

KingAmo commented 5 years ago

你好,我导入的是android,link的,但是报Invariant Violation: Invariant Violation: requireNativeComponent: "BaiduMapView" was not found in the UIManager. 请问您是怎么解决的呢?

同样的问题,有人知道怎么解决吗

kingctan commented 5 years ago

我也碰上了。pod install 方式安装的,都碰上了这个。把pod 目录中的baidu-map目录加进header search path中,也不行。还在想办法。

哪位搞定了么?

KingAmo commented 5 years ago

@kingctan https://github.com/lovebing/react-native-baidu-map/issues/256#issuecomment-500675472 看看这个能不能帮到你