【发布时间】:2015-10-08 06:21:07
【问题描述】:
我正在使用 android studio 1.4 毕业版本 2.4 android插件版本1.3.0
错误:(7, 0) Gradle DSL 方法未找到:'android()'
可能的原因:
项目“Up_13_7_2015”可能正在使用 不包含该方法的 Gradle 版本。 Gradle 设置 构建文件 可能缺少 Gradle 插件。申请 Gradle 插件
Build.gradle 文件是
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
dependencies {
apply plugin: 'announce'
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':Downloads:Android-ViewPagerIndicator-master:library')
classpath 'com.android.tools.build:gradle:1.3.0'
}
【问题讨论】: