Android Studio - Error: Failed to execute: com.android.support.constraint: constraint-layout: 1.0.0-alpha1

Screen Shot # 1 - Android Studio Gradle Project Build View

Screen Shot # 2 - Android Studio Gradle Project View Sync

After going through the "Fundamentals of Android Studio 2.2 Development" and following the instructions in chapter 3. Everything was fine until I completed the task in the book "Fundamentals of Development" (chapter 3, page 24 in the book), which said:

As you can see from the hierarchy of the component tree, the user interface layout consists of a parent layout with one child in the form of a TextView object. If Android Studio uses the RelativeLayout manager for the project, the first step is to convert it to ConstraintLayout. ConstraintLayout is a new flexible layout that is used in most projects in this book. To achieve this conversion goal, right-click the content_android_sample entry in the Component Tree and select Convert RelativeLayout to ConstraintLayout Option, as shown below:

After completing the above training task (in Chapter 3 of Essentials), an error was presented:

Error: Failed to execute: com.android.support.constraint: constraint-layout: 1.0.0-alpha1

A rendering error was also indicated, which said:

Rendering problems The following classes were not found: - android.support.constraint.ConstraintLayout (adding a design binding library dependency, fixing the build path, editing XML, creating the class)

Any thoughts on how to fix this? See Screenshots (see above). I am new to Android Studio.

Thanks so much for your time.

I use the following OS and Android Studio versions below:

Win7 Professional 64-bit

Android Studio 2.2

Assembly # AI-145.3330264, built on October 6, 2016

+7
source share
3 answers

You need to add a check ..

there is an icon called "SDK Manager", just click

open Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools

And in this dialog box add:

  • ConstraintLayout for Android
  • Solver for ConstrainLayout

enter image description here

Then here you only need to close and open Android Studio.

Perhaps you can only upgrade to:

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

+21
source

Or update your dependency:

 compile 'com.android.support.constraint:constraint-layout:latest_version' 
+4
source

upgrade to latest version

 compile 'com.android.support.constraint:constraint-layout:?.?.?' 
0
source

Source: https://habr.com/ru/post/1258559/


All Articles