Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix this > attribute app:constraintBottom_toBottomOf not found

Android newbie here.

I am building and AR app and now I'm planning to add a User Interface. I am trying to add a constraint layout to app:layout_constraintBottom_toBottomOf="parent", however Im getting the error that this constraint was not found

These are my codes and error messages:

code and errormore of error

All the lines of code I add in my activity_ux.xml file that begin with "app" e.g. app:layout_constraintBottom_toTopOf do not seem to work, I just showed you an example here with one of them just to make it easier to debug I think.

I tried searching online, one of the solutions was that I should install "ConstraintLayout for Android" and "Solver for ConstraintLayout" in my SDK Tools, but I already had this installed.

    <FrameLayout 
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          tools:context="com.google.ar.sceneform.Overlei.Overlei">

    <fragment android:name="com.google.ar.sceneform.ux.ArFragment"
          android:id="@+id/ux_fragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent" />

    <LinearLayout
          android:id="@+id/gallery_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          app:layout_constraintBottom_toBottomOf="parent"
  >

   </LinearLayout>

   </FrameLayout>

I expected this to just work, I don't know where I can start looking if an in-built function(such as this) does not work.

like image 381
ThandoBhebhe Avatar asked Mar 28 '19 16:03

ThandoBhebhe


2 Answers

Thanks for the suggestions guys. I have managed to deal with the error by adding this line

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

into my build.gradle(module.app) under dependencies

Again, thanks for everything

like image 127
ThandoBhebhe Avatar answered Oct 21 '22 01:10

ThandoBhebhe


You should use app:layout_constraintBottom_toBottomOf only in ConstraintLayout. You can try to use inside of FrameLayout then android:gravity = "bottom" in your LinearLayout.

like image 3
Beyazid Avatar answered Oct 21 '22 02:10

Beyazid