找不到根项目属性“机器人” [英] Could not find property 'android' on root project

查看:142
本文介绍了找不到根项目属性“机器人”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从日食切换我的项目到Android工作室的gradle与支持,并得到这个失败的消息


  

摇篮测试项目刷新失败:
  找不到根项目测试财产机器人。


你能帮助我吗?
我有几个子库项目

这是我的最高级别的build.gradle

  buildscript {
    库{
        mavenCentral()
    }
    依赖{
        类路径'com.android.tools.build:gradle:0.9.+
    }
}应用插件:机器人
allprojects {
    库{
        mavenCentral()
    }
}编制项目(测试)


解决方案

不要把这个在您的顶级构建文件:

 应用插件:机器人

或本

 编制项目(测试)

应用插件语句是没有必要的,因为有在多模块结构项目(这是你的项目的情况下,根级目录中没有的Andr​​oid模块)。如果你有相关性,他们需要在相关性去块在你的模块的编译文件。

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 a dependencies block in your module's build file.

这篇关于找不到根项目属性“机器人”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆