qiuxiang / react-native-amap3d

react-native 高德地图组件,使用最新 3D SDK,支持 Android + iOS
https://qiuxiang.github.io/react-native-amap3d/api/
MIT License
1.28k stars 330 forks source link

3.0.3 版本几处kt文件 语法有问题 #703

Closed JacksenLaw closed 1 year ago

JacksenLaw commented 2 years ago

该判空的地方未用 ?. 或 !!. 的写法 导致报错,运行失败

qiuxiang commented 2 years ago

对应的 RN 版本多少?另外提供错误信息

JacksenLaw commented 2 years ago

rn版本0.63.4

错误信息如下: e: \node_modules\react-native-amap3d\lib\android\src\main\java\qiuxiang\amap3d\Utils.kt: (36, 43): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableMap?

e: \node_modules\react-native-amap3d\lib\android\src\main\java\qiuxiang\amap3d\map_view\MapView.kt: (157, 57): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableMap?

e: \node_modules\react-native-amap3d\lib\android\src\main\java\qiuxiang\amap3d\map_view\MultiPoint.kt: (41, 43): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableMap?

qiuxiang commented 2 years ago

RN 之前的版本 getMap 是 nullable,但从 0.64 开始就是 non-null 的了,也就是说升级下 RN 版本就可以解决。

说实话我这边不是很想改,因为会留下坏味道。但算了,还是先支持下这些版本吧,等 RN 多迭代几个版本再彻底不止支持旧版本。