Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

Could not find Constraint Layout inside Android Studio

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...