react-native-component / react-native-smart-amap Goto Github PK
View Code? Open in Web Editor NEWreact-native 高德地图SDK 插件
License: MIT License
react-native 高德地图SDK 插件
License: MIT License
com.facebook.react.bridge.JSApplicationIllegalArgumentException:Error while updating property 'options' of a view managed by: RCTAMapView
--
com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:90)
......
Caused by:
java.lang.NullPointerException:Attempt to invoke virtual method 'android.content.res.Resources android.app.Activity.getResources()' on a null object reference
com.reactnativecomponent.amap.RCTAMapView.getImageId(RCTAMapView.java:238)
com.reactnativecomponent.amap.RCTAMapView.addMarker(RCTAMapView.java:428)
com.reactnativecomponent.amap.RCTAMapView.addLocationMarker(RCTAMapView.java:219)
com.reactnativecomponent.amap.RCTAMapView.setCenterLocation(RCTAMapView.java:355)
com.reactnativecomponent.amap.RCTAMapManager.setOptions(RCTAMapManager.java:41)
java.lang.reflect.Method.invoke(Native Method)
com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:78)
com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:36)
com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:125)
com.facebook.react.uimanager.UIViewOperationQueue$UpdatePropertiesOperation.execute(UIViewOperationQueue.java:92)
com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:784)
com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:831)
com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:45)
com.facebook.react.uimanager.UIViewOperationQueue$3.run(UIViewOperationQueue.java:809)
android.os.Handler.handleCallback(Handler.java:808)
android.os.Handler.dispatchMessage(Handler.java:101)
android.os.Looper.loop(Looper.java:166)
android.app.ActivityThread.main(ActivityThread.java:7425)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
RN 0.55 报Undefined is not an object(evaluating ‘_react2.PropTypes.shape’)错误
网上查找了,添加了import PropTypes from 'prop-types';
依然报错,如何解决?
Showing All Issues
Ld /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator/maptest.app/PlugIns/maptestTests.xctest/maptestTests normal x86_64
cd /Users/jiu/Documents/maptest/ios
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -L/Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator -F/Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator -F/Users/jiu/Documents/maptest/ios/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Intermediates/maptest.build/Debug-iphonesimulator/maptestTests.build/Objects-normal/x86_64/maptestTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -bundle_loader /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator/maptest.app/maptest -Xlinker -object_path_lto -Xlinker /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Intermediates/maptest.build/Debug-iphonesimulator/maptestTests.build/Objects-normal/x86_64/maptestTests_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -framework XCTest -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Intermediates/maptest.build/Debug-iphonesimulator/maptestTests.build/maptestTests.xctest.xcent /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator/libReact.a -framework AMapFoundationKit -framework MAMapKit -framework AMapSearchKit -Xlinker -dependency_info -Xlinker /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Intermediates/maptest.build/Debug-iphonesimulator/maptestTests.build/Objects-normal/x86_64/maptestTests_dependency_info.dat -o /Users/jiu/Library/Developer/Xcode/DerivedData/maptest-djaltoxhmqviunafoxlskehcltkg/Build/Products/Debug-iphonesimulator/maptest.app/PlugIns/maptestTests.xctest/maptestTests
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_CNCopyCurrentNetworkInfo", referenced from:
-[AMapStatistics fetchSSIDInfo] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"inflateInit2", referenced from:
+[AMapFoundationCompression GZipInflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_unzOpenCurrentFile3 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_inflate", referenced from:
+[AMapFoundationCompression GZipInflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_unzReadCurrentFile in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_CNCopySupportedInterfaces", referenced from:
-[AMapStatistics fetchSSIDInfo] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCError", referenced from:
-[AMapFoundationReachability startNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_deflateEnd", referenced from:
_zipCloseFileInZipRaw64 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
+[AMapFoundationCompression GZipDeflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_crc32", referenced from:
_zipWriteInFileInZip in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_unzReadCurrentFile in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"deflateInit2", referenced from:
_zipOpenNewFileInZip4_64 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
+[AMapFoundationCompression GZipDeflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_get_crc_table", referenced from:
_zipOpenNewFileInZip4_64 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_unzOpenCurrentFile3 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCNetworkReachabilitySetDispatchQueue", referenced from:
-[AMapFoundationReachability startNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
-[AMapFoundationReachability stopNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCNetworkReachabilityGetFlags", referenced from:
-[AMapFoundationReachability reachabilityFlags] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
-[AMapFoundationReachability isReachable] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
-[AMapFoundationReachability isReachableViaWWAN] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
-[AMapFoundationReachability isReachableViaWiFi] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCNetworkReachabilitySetCallback", referenced from:
-[AMapFoundationReachability startNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
-[AMapFoundationReachability stopNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_inflateEnd", referenced from:
+[AMapFoundationCompression GZipInflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_unzCloseCurrentFile in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_deflate", referenced from:
_zipWriteInFileInZip in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
_zipCloseFileInZipRaw64 in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
+[AMapFoundationCompression GZipDeflateWithSource:] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCErrorString", referenced from:
-[AMapFoundationReachability startNotifier] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
"_SCNetworkReachabilityCreateWithAddress", referenced from:
-[AMapFoundationReachability init] in AMapFoundationKit(AMapFoundationKit-x86_64-master.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
修改为:import com.reactnativecomponent.amap.RCTAMapPackage; //加入地图功能
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AMapGeoPoint", referenced from:
objc-class-ref in libRCTAMap.a(RCTAMapManager.o)
"_OBJC_CLASS_$_AMapLocationManager", referenced from:
objc-class-ref in libRCTAMapLocation.a(RCTAMapLocation.o)
"_OBJC_CLASS_$_AMapPOIAroundSearchRequest", referenced from:
objc-class-ref in libRCTAMap.a(RCTAMapManager.o)
"_OBJC_CLASS_$_AMapSearchAPI", referenced from:
objc-class-ref in libRCTAMap.a(RCTAMapManager.o)
"_OBJC_CLASS_$_MAMapView", referenced from:
_OBJC_CLASS_$_RCTAMap in libRCTAMap.a(RCTAMap.o)
"_OBJC_CLASS_$_MAPinAnnotationView", referenced from:
objc-class-ref in libRCTAMap.a(RCTAMapManager.o)
"_OBJC_CLASS_$_MAPointAnnotation", referenced from:
objc-class-ref in libRCTAMap.a(RCTAMapManager.o)
"_OBJC_METACLASS_$_MAMapView", referenced from:
_OBJC_METACLASS_$_RCTAMap in libRCTAMap.a(RCTAMap.o)
我按照你简书的教程,新添加了searchLocation方法,也改了原生代码,但是看了官网的InputtipsQuery类跟你的版本有差距,官网版本有setLocation(LatLonPoint location)这个方法,我设置了setCityLimit(true)也没有限制当前城市查询,我在杭州查询加油站,查询出来的事吉林省的加油站,请问怎么修改
我是这样调用的 ,经纬度传值也是正常的,但是界面没有显示地图,用的android调试的,求教!
谢谢!
<AMap
ref={ component => this._amap = component }
options={{
frame: {
width: window.width,
height: window.height
},
showsUserLocation: false,
userTrackingMode: Platform.OS == 'ios' ? AMap.constants.userTrackingMode.none : null,
centerCoordinate: {
latitude: this.props.route.lat,
longitude: this.props.route.lng,
},
zoomLevel: 18.1,
centerMarker: Platform.OS == 'ios' ? 'icon_location' : 'poi_marker',
}}
style={{flex:1}}
onLayout={this._onLayout}
/>
在 [email protected] 中我安装调用之后包userTrackingMode不存在的错误,console 了一下NativeModules对象,发现对象中并没有 AMap 这个对象。
安卓真机是我设置得不对吗?
<AMap
style={{ flex:1}}
options={{
centerCoordinate: {
latitude: 40.53835,
longitude: 100.50336,
},
showsUserLocation: false,
centerMarker:'poi_marker'
}}
ref={v => this.map = v}
/>
如题所示,我在Android中build项目的时候会出现这样的错误
`
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
E:\react-native\ReactNativePlatform\android\app\src\main\java\com\reactnativeplatform\MainApplication.java:13: 错误: 程 序包com.reactnativecomponent.amaplocation不存在
import com.reactnativecomponent.amaplocation.RCTAMapPackage;
^
E:\react-native\ReactNativePlatform\android\app\src\main\java\com\reactnativeplatform\MainApplication.java:33: 错误: 找 不到符号
new RCTAMapPackage() //register Module
^
符号: 类 RCTAMapPackage
2 个错误
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
`
是不是导入包地址错误了,可以我是按照readme上面的写的
版本
"react": "16.0.0-alpha.6",
"react-native": "0.43.3",
"react-native-smart-amap": "^1.0.4",
使用amap-location定位得到的定位数据,然后将它的经纬度设置成amap的中心点,结果发现虽然地图显示的位置与实际位置偏差不大,但是使用searchPoiByCenterCoordinate方法得到的周边poi却偏差很大,得到的周边在实际生活中偏差一两公里
Unhandled JS Exception: undefined is not an object (evaluating '_reactNativeSmartAmapLocation2.default.init')使用了react-native-smart-amap-location组件定位就一直报这样错
您好,我的[email protected],Xcode是8.2.1,按照安装步骤安装后,启动会报Cannot read property 'userTrackingMode' of undefined
错误,我想问一下您知道是我哪里安装的不对,还是不兼容[email protected]吗?
配置好了,但是怎么集成到自己的RN页面中去?不能用啊
RCTAMapView中 init方法,MAPVIEW = new MapView(CONTEXT); mapview这个对象是存在的,但是width和height为0,没看到其他的错误信息,求解
我现在使用的是centerMarker来显示,可是当拖动地图的时候,这个marker一直是在中心的。定位的位置就变了。
运行ReactNativeComponentDemos
地图显示为空白
高德地图SDK key 用demo里的不行,
后来换成我自己的key还是不行
2D效果实在太丑陋了
很多API 都没有,顺便问个问题,IOS 这个中心点图片在哪里更改,或者图片资源应该放在那里,一直没有这个蓝灯泡中心点图片,谢谢
错误: 程序包com.reactnativecomponent.amaplocation不存在
希望大神抽空 看下是否有这个问题?
E:\react-native\myProject\node_modules\react-native-smart-amap\android\src\main\java\com\reactnativecomponent\amap\RCTAMapPackage.java:23: 错误: 方法不会覆盖或实现超类型的方法
@OverRide
^
注: E:\react-native\myProject\node_modules\react-native-smart-amap\android\src\main\java\com\reactnativecomponent\amap\util\SensorEventHelper.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
1 个错误
iOS 地图设置了大小,但是进到地图页面还是全屏,有什么解决的方法吗
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.