无法为Android 1.0.2安装Constraintlayout [英] failed to install constraintlayout for android 1.0.2

查看:506
本文介绍了无法为Android 1.0.2安装Constraintlayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是AndroidStudio和android编程的新手,请帮助我解决问题 当我在AndroidStudio v3.1.4上创建新项目时,第一时间构建在20秒构建同步失败后开始同步并显示此错误:

I am new to AndroidStudio and android programing please help me to solve my problem when I create new project on AndroidStudio v3.1.4 frist time build is started to sync after 20 seconds build sync failed and show me this error :

无法解决':app @ debug/compileClasspath'的依赖关系:可以 无法解析com.android.support.constraint:constraint-layout:1.1.3.

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.3.

和错误:

无法解决以下项的依赖关系 ':app @ debugAndroidTest/compileClasspath':无法解析 com.android.support.test:runner:1.0.2.

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.2.

还有另外5个错误...

and Such 5 more error...

我安装了最新的SDK工具和插件.

I installed latest Sdk tools and Plugins..

我尝试从SDK管理器上的SDK工具TAB安装android 1.0.2的约束布局和约束布局的求解程序,检查该选项,然后应用 android studio开始下载并安装,并在10秒钟后说安装完成!

I try to install constraintlayout for android 1.0.2 and solver for constraintlayout from SDK tools TAB on SDK manager Check that option then apply android studio start to download and installed and after 10 seconds say that installing finished!

这意味着安装成功,但是当我关闭该窗口时,表明那些选项早已取消选中并显示状态未安装"

This means that installed successfully But when I close that window show that those option early unchecked and show status "not installed"

推荐答案

我也遇到了这个问题.事实证明由于某种原因启用了gradle的脱机工作.因此,gradle试图获取未缓存到android studio的约束布局的版本.要在android studio上启用离线工作,请依次点击文件>设置>构建执行部署> Gradle.从那里您可以看到一个用于离线工作的复选框,将其禁用.希望这会有所帮助.

I had this problem too. Turns out offline work for gradle was enabled for some reason. As such gradle is trying to get the version of constraint layout that is not cached to android studio. To enable offline work on android studio click File > Settings> Build Execution Deployment >Gradle. From there you can see a check box for offline work disable it. Hope this helps.

这篇关于无法为Android 1.0.2安装Constraintlayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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