找不到根项目属性“机器人” [英] Could not find property 'android' on root project
问题描述
我想从日食切换我的项目到Android工作室的gradle与支持,并得到这个失败的消息
摇篮测试项目刷新失败:
找不到根项目测试财产机器人。
块引用>你能帮助我吗?
我有几个子库项目这是我的最高级别的build.gradle
buildscript {
库{
mavenCentral()
}
依赖{
类路径'com.android.tools.build:gradle:0.9.+
}
}应用插件:机器人
allprojects {
库{
mavenCentral()
}
}编制项目(测试)
解决方案不要把这个在您的顶级构建文件:
应用插件:机器人
或本
编制项目(测试)
的
应用插件
语句是没有必要的,因为有在多模块结构项目(这是你的项目的情况下,根级目录中没有的Android模块)。如果你有相关性,他们需要在相关性去
块在你的模块的编译文件。i want to switch my project from eclipse to android studio with gradle support and get this failure message
Gradle 'Test' project refresh failed: Could not find property 'android' on root project 'Test'.
Could you help me? I have a project with a few sublibraries
This is my top level build.gradle
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } apply plugin: android allprojects { repositories { mavenCentral() } } compile project('Test')
解决方案Don't put this in your top-level build file:
apply plugin: android
or this:
compile project('Test')
The
apply plugin
statement isn't necessary because there's no Android module in the root-level directory of projects with multi-module structure (which is the case for your project). And if you have dependencies, they need to go in adependencies
block in your module's build file.这篇关于找不到根项目属性“机器人”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!