Could not find Constraint Layout inside Android Studio

。_饼干妹妹 提交于 2019-12-25 09:17:47

问题


Everything was working fine inside studio, but then I get error:

Could not find com.android.support.constraint:constraint-layout:1.0.0-beta4.

Problem is that I can not install Constraint layout in Android Studio because I am using Ubuntu.I can not find SDK Tools(System Settings) to install manually like usually on MAC.

None of solutions here worked for me because they are mostly for MAC OS.

I am using Android 2.2 on Ubuntu 14.04, and Gradle 2.2.2.


回答1:


I am using Android 2.2

if you use preview 1 than try with

compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'

Gradle

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

inside gradle wrapper

distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip

make sure you un-check from offline if you have not gradle 2.14.1

build Tools Version

buildToolsVersion ' 25 '

Best way if you have installed gradle 2.14.1-all then just go to your layout and then design tab, rignt click on your layout, click to convert,if you haven't installed Constraint lib you see a popup that says install lib, and click on ok. and then you can see in app level gradle file Constraint layout dependency added.



来源:https://stackoverflow.com/questions/40788918/could-not-find-constraint-layout-inside-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!