Reputation: 3484
I am trying to group the widgets on my layout using a Constraint Layout group android.support.constraint.Group
, but despite adding the gradle dependency (implementation 'com.android.support.constraint:constraint-layout:1.0.2'
), Android Studio does not seem to recognize this tag in xml. Here's my layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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.udemy.mehdi.materialanimations.MainActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/start"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/android"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<android.support.constraint.Group
android:id="@+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="image,recyclerView"
android:visibility="visible"
/>
</android.support.constraint.ConstraintLayout>
The error I get when I perform build is as follows:
Error:error: attribute me.john.myapp:constraint_referenced_ids' not found.
I am using the following Gradle configuration:
repositories{
google()
center()
}
dependencies{
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}
Upvotes: 0
Views: 1220
Reputation: 55
Try a higher version of ConstraintLayout
implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta5'
Upvotes: 2