NMeneses
NMeneses

Reputation: 172

No resource identifier found for attribute 'layout_constraintBottom' in package

I'm trying to build a simple android app in Android Studio 2.3.2, but I'm getting the following error for component I add to the app: "No resource identifier found for attribute 'layout_constraintBottom' in package 'com..."

I researched this problem and found that some people are getting a similar error. However, the answers are suggesting to add "compile 'com.android.support.constraint:constraint-layout:1.0.2'" to the gradle.build file. When I looked there, the line is already in place.

Here is a snippet of my code:

<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/main_menu"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.example.nmeneses.scorekeeper.MainMenu"
    tools:showIn="@layout/activity_main_menu">

<Button
    android:id="@+id/button3"
    android:layout_width="128dp"
    android:layout_height="79dp"
    android:layout_marginBottom="50dp"
    android:layout_marginLeft="39dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="8dp"
    android:text="Teams"
    android:textSize="23dp"
    app:layout_constraintBottom="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintHorizontal_bias="0.066"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="1.0" />

Any help would be greatly appreciated. If you need more info, please let me know.

Upvotes: 0

Views: 1864

Answers (1)

Cheticamp
Cheticamp

Reputation: 62831

AFAIK there is no attribute layout_constraintBottom in ConstraintLayout. There is layout_constraintBottom_toTopOf and layout_constraintBottom_toBottomOf.

I suggest that you use the following line instead:

 app:layout_constraintBottom_toBottomOf="parent"

Upvotes: 1

Related Questions