我尝试通过添加在线maven依赖项在我的程序中使用Quickblox API.我正在使用Android Studio.
当我尝试构建我的程序时,它显示以下错误:
错误:(52,0)未找到Gradle DSL方法:`сompile()`可能的原因:项目'Nanny Watch'可能正在使用不包含该方法的Gradle版本.
打开Gradle包装文件构建文件可能缺少Gradle插件.
应用Gradle插件
这是build.gradle(Project:NannyWatch2)文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Run Code Online (Sandbox Code Playgroud)
这是build.gradle(Module:App)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.user.nannywatch"
minSdkVersion 16
targetSdkVersion …Run Code Online (Sandbox Code Playgroud)