react-native-amap3d icon indicating copy to clipboard operation
react-native-amap3d copied to clipboard

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

Open JacksenLaw opened this issue 4 years ago • 3 comments

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

JacksenLaw avatar Dec 06 '21 09:12 JacksenLaw

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

qiuxiang avatar Dec 06 '21 10:12 qiuxiang

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?

JacksenLaw avatar Dec 06 '21 11:12 JacksenLaw

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

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

qiuxiang avatar Dec 07 '21 08:12 qiuxiang