【发布时间】:2015-10-14 21:32:08
【问题描述】:
我尝试将我的 Eclipse 项目导入 Android Studio。但我陷入了这个错误。
“错误:(1, 0) 未找到 ID 为 'android' 的插件”
以下是我的 gradle 构建。
应用插件:'com.android.application'
依赖{ 编译文件树(目录:'libs',包括:'*.jar') 编译项目(':下载:PdfLib') }
机器人{ compileSdkVersion 16 buildToolsVersion "22.0.1"
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')
}
}
【问题讨论】:
-
在您的应用程序 gradle defaultConfig { applicationId "your package name or application id" minSdkVersion 16 targetSdkVersion 22 } 上试试这个