react-native-baidumap-sdk
react-native-baidumap-sdk copied to clipboard
Android编译失败
版本:"react-native-baidumap-sdk": "^0.6.1-2",
日志:
e: G:\xxxxxx\node_modules\react-native-baidumap-sdk\lib\android\src\main\java
cn\xxxxxx\react\baidumap\Utils.kt: (52, 56): Only safe (?.) or non-null assert
ed (!!.) calls are allowed on a nullable receiver of type ReadableMap?
e: G:\xxxxxx\node_modules\react-native-baidumap-sdk\lib\android\src\main\java
cn\qiuxiang\react\baidumap\mapview\BaiduMapHeatMap.kt: (20, 43): Only safe (?.)
or non-null asserted (!!.) calls are allowed on a nullable receiver of type Read
ableMap?
e: G:\xxxxxx\node_modules\react-native-baidumap-sdk\lib\android\src\main\java
cn\qiuxiang\react\baidumap\mapview\BaiduMapHeatMap.kt: (20, 67): Only safe (?.)
or non-null asserted (!!.) calls are allowed on a nullable receiver of type Read
ableMap?
e: G:\xxxxxx\node_modules\react-native-baidumap-sdk\lib\android\src\main\java
cn\qiuxiang\react\baidumap\mapview\BaiduMapView.kt: (179, 40): Only safe (?.) or
non-null asserted (!!.) calls are allowed on a nullable receiver of type Readab
leMap?
Task :react-native-baidumap-sdk:compileReleaseKotlin FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-baidumap-sdk:compileReleaseKotlin'.
Compilation error. See log for more details
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
+1
+1 RN 0.59.2
https://blog.csdn.net/u010296640/article/details/80421135 应该是kotlin 插件升级导致的,我按这上面先把代码改了下,就可以跑了
@TZXZ 有例子吗
我是先这样改着,项目跑起来先,具体的改动还是等作者来吧
谢谢
将项目内react-native版本降为0.58.6后解决。作者的高德地图版也同样存在这个问题,react-native 0.59下报错无法运行
将项目内react-native版本降为0.58.6后解决。作者的高德地图版也同样存在这个问题,react-native 0.59下报错无法运行
+1 不过我这里0.58.6还需要更改kotlin插件配置从1.2.41改成1.2.51才能正常运行。
我是先这样改着,项目跑起来先,具体的改动还是等作者来吧
用了您的方法,项目成功跑起来了,非常感谢。不知作者何时会更新。
RN 0.59以上遇到这个问题,需要先把组件的build.gradle升级ext.kotlin_version的kotlin版本,然后在BaiduMapPackage.kt 和 Utils.kt 文件里面把对应出错的地方加上 !!(在 . 之前),可以解决这个问题。
已经解决了,感谢大佬的奉献。
------------------ 原始邮件 ------------------ 发件人: "陈小赫"[email protected]; 发送时间: 2019年4月26日(星期五) 下午3:39 收件人: "qiuxiang/react-native-baidumap-sdk"[email protected]; 抄送: "小强~i"[email protected]; "Comment"[email protected]; 主题: Re: [qiuxiang/react-native-baidumap-sdk] Android编译失败 (#179)
RN 0.59以上遇到这个问题,需要先把组件的build.gradle升级ext.kotlin_version的kotlin版本,然后在BaiduMapPackage.kt 和 Utils.kt 文件里面把对应出错的地方加上 !!(在 . 之前),可以解决这个问题。
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
RN 0.59以上遇到这个问题,需要先把组件的build.gradle升级ext.kotlin_version的kotlin版本,然后在BaiduMapPackage.kt 和 Utils.kt 文件里面把对应出错的地方加上 !!(在 . 之前),可以解决这个问题。
@qiuxiang 大佬能把这个发一个版本么。每次都要重新改很麻烦的。
我是先这样改着,项目跑起来先,具体的改动还是等作者来吧
用了您的方法,项目成功跑起来了,非常感谢。不知作者何时会更新。
这样改了之后第一次进来经纬度为空就报错了
<MapView style={StyleSheet.absoluteFill} center={{ latitude: currentLocation.latitude, longitude: currentLocation.longitude }} zoomLevel = {19} buildingsDisabled={true} onClick={(latLng)=>{ this.getAddress(latLng); }} >