- 🔭 I’m currently working on seata-js
- 👯 I’m looking to collaborate on dubbo-js
- 📫 How to reach me: [email protected]
hufeng / baidumapkit Goto Github PK
View Code? Open in Web Editor NEW百度地图的React-Native Android版本
License: MIT License
百度地图的React-Native Android版本
License: MIT License
RT,地图可以正常显示,但是无法显示marker,设置普通/卫星模式以及热力图都无效。
求回复~
我通过搜索发现有很多个AndroidManifest.xml 所以不知道修改哪一个
MainActivity中注册变成了:
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),new BaiduMapReactPackage(this)
);
}
编译过程中显示一大堆unknown source,类似:
Unknown source file : warning: Ignoring InnerClasses attribute for an anonymous inner class
Unknown source file : (com.baidu.platform.comapi.b) that doesn't come with an
Unknown source file : associated EnclosingMethod attribute. This class was probably produced by a
Unknown source file : compiler that did not target the modern .class file format. The recommended
Unknown source file : solution is to recompile the class from source, using an up-to-date compiler
Unknown source file : and without specifying any "-target" type options. The consequence of ignoring 。。。。。
,最后编译完毕,部署到真机或者模拟器,点击都会立即显示应用无法响应;logcat中显示一大堆错误,其中一个好像是初始化过程中的错误:
05-11 15:19:14.857: I/ReactNativeJS(18155): Running application "MyProject" with appParams: {"initialProps":{},"rootTag":1}. DEV === true, development-level warning are ON, performance optimizations are OFF
05-11 15:19:14.879: W/ReactNativeJS(18155): Warning: ReactNative.createElement is deprecated. Use React.createElement from the "react" package instead.
05-11 15:19:14.901: E/unknown:React(18155): Exception in native call from JS
05-11 15:19:14.901: E/unknown:React(18155): java.lang.IllegalStateException: you have not supplyed the global app context info from SDKInitializer.initialize(Context) function.
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.platform.comapi.a.b(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.BMapManager.init(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.map.MapView.a(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.map.MapView.(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.bee.baidumapview.BaiduMapViewManager.createViewInstance(BaiduMapViewManager.java:112)
05-11 15:19:14.901: E/unknown:React(18155): at com.bee.baidumapview.BaiduMapViewManager.createViewInstance(BaiduMapViewManager.java:19)
05-11 15:19:14.901: E/unknown:React(18155): at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44)
05-11 15:19:14.901: E/unknown:React(18155): at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManag
后边显示:
05-11 15:19:14.974: E/AndroidRuntime(18155): FATAL EXCEPTION: mqt_native_modules
代码是你的样例程序,不知道什么问题;
你能验证一下吗?
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':baidumapkit'.
> Could not resolve all dependencies for configuration ':baidumapkit:_debugCompile'.
> Could not find com.android.support:appcompat-v7:23.1.1.
Searched in the following locations:
file:/Users/shevawen/.m2/repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
file:/Users/shevawen/.m2/repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
http://dl.bintray.com/mkonicek/maven/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
http://dl.bintray.com/mkonicek/maven/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
file:/Users/shevawen/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
file:/Users/shevawen/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
file:/Users/shevawen/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom
file:/Users/shevawen/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar
Required by:
AlertsPro:baidumapkit:unspecified
> Could not find com.android.support:appcompat-v7:23.1.1.
java.lang.AbstractMethodError: abstract method not implemented
at com.bee.baidumapview.BaiduMapShadowNode.measure(BaiduMapShadowNode.java)
at com.facebook.csslayout.CSSNode.measure(CSSNode.java:137)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:294)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:633)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:633)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:492)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:633)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:633)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:492)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.LayoutEngine.layoutNodeImpl(LayoutEngine.java:492)
at com.facebook.csslayout.LayoutEngine.layoutNode(LayoutEngine.java:210)
at com.facebook.csslayout.CSSNode.calculateLayout(CSSNode.java:146)
at com.facebook.react.uimanager.UIImplementation.calculateRootLayout(UIImplementation.java:674)
at com.facebook.react.uimanager.UIImplementation.dispatchViewUpdates(UIImplementation.java:445)
at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:423)
at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:119)
at com.facebook.react.bridge.CatalystInstanceImpl$NativeModulesReactCallback.onBatchComplete(CatalystInstanceImpl.java:442)
at com.facebook.react.bridge.queue.NativeRunnableDeprecated.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:136)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:184)
at java.lang.Thread.run(Thread.java:841)
建议注册组件部分使用rnpm
build 通过了,APP启动大姨妈显示这个错误。
以前没开发过移动端 对第四步表示看不懂 能具体点吗?
请问下,在rn0.18上怎么使用?
按着步骤做的,始终报错,估计是版本太老了,rn已经更新到0.32.0了,我用的是0.31.0,不知道博主后期是否更新呢?
RT
compile project(':baidukitmap')
should be compile project(':baidumapkit')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.