react-native-screens:compileDebugKotlin编译失败问题求助
React Native 编译错误:
:react-native-screens:compileDebugKotlin 失败 问题详情
编译项目时触发如下错误:
> Task :react-native-screens:compileDebugKotlin FAILED * What went wrong: Execution failed for task ':react-native-screens:compileDebugKotlin'. > Compilation error. See log for more details
已尝试过相关issue的解决方案但无效,当前版本信息:
"react-native": "0.61.5" "react-native-screens": "^3.18.2"
可行解决方案
降级react-native-screens版本
RN 0.61.x版本与react-native-screens@3.x存在兼容性冲突,最高适配2.15.0版本,执行命令降级:npm install react-native-screens@2.15.0 --save # 用yarn的话执行:yarn add react-native-screens@2.15.0清理缓存并重构项目
执行以下命令清除各类缓存后重新构建:npm cache clean --force npx react-native start --reset-cache cd android && ./gradlew clean && cd .. npx react-native run-android确认Kotlin版本匹配
RN 0.61.5默认依赖Kotlin 1.3.50,打开android/build.gradle文件,检查并修改Kotlin版本配置:buildscript { ext { kotlinVersion = "1.3.50" } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } }
内容的提问来源于stack exchange,提问作者Tafsir Ahamed
相关产品推荐
相关产品推荐

