当我试图运行它说无法解决所有依赖

时间:2016-07-15 06:19:10

标签: android

enter image description here

我是否需要更改类路径?

3 个答案:

答案 0 :(得分:0)

打开您的Project App (build.gradle)文件打开此文件

build.gradle(Project:SocialApp)

此文件中的

将您的依赖项更改为此

classpath 'com.android.tools.build:gradle:2.2.0-alpha3'

完整代码:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
       classpath 'com.android.tools.build:gradle:2.2.0-alpha3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Sync它将起作用的项目..

答案 1 :(得分:0)

Documentation建议使用:

dependencies {
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
}

另外,建议使用:

  

确保您拥有最新的Android支持存储库(版本32或更高版本)

更新你的库(记得同步你的Gradle项目并在必要时更新Gradle) - 在此之后,它应该开始工作。

答案 2 :(得分:0)

首先你必须检查“contraint layout”存储库support.check out like this.SDKmanager-> SDKTools->检查

'com.android.support.constraint:constraint-layout:1.0.0-alpha4'

是否安装..如果没有安装,则安装它。然后尝试同步项目。