我正在研究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/