我阅读了如何从Google开发人员网站添加支持存储库
http://developer.android.com/intl/es/tools/support-library/setup.html
并在构建文件上导致错误
我找不到有关主题的任何解决方案
这是我的build.gradlew
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
compile "com.android.support:appcompat-v7:23.1.0"
}
}
apply plugin: 'android'
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion '23.0.1'
buildTypes {
release {
minifyEnabled true
proguardFile getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}
我得到编译结果
> Could not find method compile() for arguments [com.android.support:support:23.1.0] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@37f86333.
最佳答案
您正在将buildscript dependencies与configuration dependencies混合在一起:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:1.5.0"
}
}
// ...
repositories {
mavenCentral()
}
dependencies {
compile "com.android.support:appcompat-v7:23.1.0"
}