android - 更新 Android Studio 插件后,React Native Android 出现错误 MultipleCompilationErrorsException 启动失败
问题描述
我正在使用 Android Studio 开发 React Native App。最近 Android Studio 要求我进行一些更新,所以我点击更新了 IDE 的一些插件。
现在,当我尝试构建时出现错误:
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
我的 build.grale 内容:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:3.6.1')
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
解决方案
这样做后修复:
rm -rf node_modules
yarn // install react native project dependencies
yarn cache clean
删除 .idea 项目 Android Studio
在 Android Studio 中重新打开项目并再次构建
推荐阅读
- node.js - 如何将 node-fetch 与 Cloud Functions for Firebase 结合使用。无法部署
- javascript - 语义UI React中的React Router Navigate问题
- android - 如何在 SpannableString 中查找子字符串的索引
- aix - 在 AIX 上测试 shell 脚本
- python-3.x - 运行 PyMC3 模型时如何解决内存错误
- python - 在 WhatsThis 中复制/选择文本
- java - 练习 getter setter 时无法打印所需的输出
- html - 是否可以使用overflow-y进行分页:滚动
- typescript - 如何缩小 TS2339 的类型:“错误 | 类型”上不存在属性“数据” 类型与数据'?
- javascript - 当在另一个页面上单击锚链接时,我试图在滚动到一个 ID 时打开我的手风琴