react-native-baidumap-sdk icon indicating copy to clipboard operation
react-native-baidumap-sdk copied to clipboard

Android编译失败

Open Jeijie opened this issue 5 years ago • 13 comments

版本:"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.

Jeijie avatar Mar 20 '19 01:03 Jeijie

+1

haireggs avatar Mar 21 '19 09:03 haireggs

+1 RN 0.59.2

yqz0203 avatar Mar 27 '19 03:03 yqz0203

https://blog.csdn.net/u010296640/article/details/80421135 应该是kotlin 插件升级导致的,我按这上面先把代码改了下,就可以跑了

TZXZ avatar Mar 27 '19 10:03 TZXZ

@TZXZ 有例子吗

Jeijie avatar Mar 27 '19 11:03 Jeijie

image 我是先这样改着,项目跑起来先,具体的改动还是等作者来吧

TZXZ avatar Mar 27 '19 12:03 TZXZ

谢谢

Jeijie avatar Mar 28 '19 00:03 Jeijie

将项目内react-native版本降为0.58.6后解决。作者的高德地图版也同样存在这个问题,react-native 0.59下报错无法运行

haireggs avatar Mar 28 '19 01:03 haireggs

将项目内react-native版本降为0.58.6后解决。作者的高德地图版也同样存在这个问题,react-native 0.59下报错无法运行

+1 不过我这里0.58.6还需要更改kotlin插件配置从1.2.41改成1.2.51才能正常运行。

yqz0203 avatar Mar 28 '19 01:03 yqz0203

image 我是先这样改着,项目跑起来先,具体的改动还是等作者来吧

用了您的方法,项目成功跑起来了,非常感谢。不知作者何时会更新。

xiaoqiang1999 avatar Apr 14 '19 04:04 xiaoqiang1999

RN 0.59以上遇到这个问题,需要先把组件的build.gradle升级ext.kotlin_version的kotlin版本,然后在BaiduMapPackage.kt 和 Utils.kt 文件里面把对应出错的地方加上 !!(在 . 之前),可以解决这个问题。

Geek-ch avatar Apr 26 '19 07:04 Geek-ch

已经解决了,感谢大佬的奉献。

------------------ 原始邮件 ------------------ 发件人: "陈小赫"[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.

xiaoqiang1999 avatar Apr 26 '19 07:04 xiaoqiang1999

RN 0.59以上遇到这个问题,需要先把组件的build.gradle升级ext.kotlin_version的kotlin版本,然后在BaiduMapPackage.kt 和 Utils.kt 文件里面把对应出错的地方加上 !!(在 . 之前),可以解决这个问题。

@qiuxiang 大佬能把这个发一个版本么。每次都要重新改很麻烦的。

SuGod avatar May 29 '19 05:05 SuGod

image 我是先这样改着,项目跑起来先,具体的改动还是等作者来吧

用了您的方法,项目成功跑起来了,非常感谢。不知作者何时会更新。

这样改了之后第一次进来经纬度为空就报错了 <MapView style={StyleSheet.absoluteFill} center={{ latitude: currentLocation.latitude, longitude: currentLocation.longitude }} zoomLevel = {19} buildingsDisabled={true} onClick={(latLng)=>{ this.getAddress(latLng); }} >

liumin007 avatar Apr 02 '20 12:04 liumin007