reactjs - 错误 :Could not find method getCompileConfiguration() for arguments [] on object of type com. android.build.gradle.internal.api.ApplicationVariantImpl

标签 reactjs react-native gradle crash android-studio-3.0

我正在研究React Native技术,一切都工作正常,直到昨天和今天,当我在android studio中打开react-native项目时,它给了我这个错误:

Error:Could not find method getCompileConfiguration() for arguments [] on object of type com.android.build.gradle.internal.api.ApplicationVariantImpl.

请帮助我找到解决此问题的最佳解决方案。

谢谢

最佳答案

我认为这是由于 com.google.gms:google-services 发布了一个与 gradle 构建工具不兼容的新版本,为了修复它,我更改了 android/build .gradle

dependencies {
  - classpath 'com.android.tools.build:gradle:2.2.+'
  - classpath 'com.google.gms:google-services:3.+'
  + classpath 'com.android.tools.build:gradle:2.2.3'
  + classpath 'com.google.gms:google-services:3.2.1'
}

要使用严格版本,请按照文档 here

关于reactjs - 错误 :Could not find method getCompileConfiguration() for arguments [] on object of type com. android.build.gradle.internal.api.ApplicationVariantImpl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50136317/

相关文章:

gradle - 如何将依赖项添加到 kotlinCompilerClasspath?

android - 未找到名称为 'compileClasspath' 的配置

error-handling - React中如何获取父组件的名称?

javascript - 在 React Native 中正确使用动画 API

javascript - react onClick 不触发

android - 将 buildToolsVersion 更新为 '26.0.2' 后出错

javascript - 使用 Mapbox 更新 Prop 的正确方法

android - React-native Android Systrace HTML 在 Ubuntu 14.04 中是空白的

css - 在flexBox中指定换行符

android - 无法安装产品口味的发行版APK