Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install android constraint layout tools outside of Android Studio by using the command line?

Tags:

android

I'm manually installing an Android-Gradle build server which means that I'm not using Android Studio SDK but instead using the android update sdk command to install the required tools.

I was able to install most of the packages which are required for the build to finish successfully but there are some tools which I'm unable to find:

com.android.support.constraint:constraint-layout:1.0.0-alpha(1-4)
com.android.support.constraint:constraint-layout-solver:1.0.0-alpha(1-4)

Following @CommonsWare comment, here's the output of the build (which shows that the tools are being looked for at the repositories automatically but not found:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':Company'.
> Could not resolve all dependencies for configuration ':Company:_productionDebugCompile'.
   > Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha4.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
         https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
         http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
         http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
         file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
         file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
         file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
         file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
     Required by:
         Company-Android_fork:Company:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.163 secs

Any idea how they can be installed manually (not through Android Studio)?

Thanks in advance,

like image 795
Itai Ganot Avatar asked Aug 31 '16 14:08

Itai Ganot


People also ask

Where is command-line in Android Studio?

Open a command line—from Android Studio, select View > Tool Windows > Terminal—and navigate to the directory where your unsigned APK is located.

How can we solve missing constraints in constraint layout?

To automatically apply any missing constraints you can press the 'Infer Constraints' button at the top of the editor. The red warning sign should now have turned yellow because we have resolved the missing constraints error. Also, the TextView object should have blue arrows coming out of it when selected in the editor.

How many constraint handles are available to us as part of the ConstraintLayout?

The TextView above has three types of handles: Resize handle - It's present on the four corners and is used to resize the view, but keeping its constraints intact. Side handle - It's the circular handle present on the centre of each side. It's used to set the top, left, bottom and right constraints of the view.


1 Answers

Now you can install it through command line:

your_sdk_location/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
like image 86
Andrey Rechitsky Avatar answered Oct 12 '22 23:10

Andrey Rechitsky