Layout resource file cannot be created due to constraint layout

Asked 2 years ago, Updated 2 years ago, 82 views

To create a guideline, I entered android.support.constrain.constrainLayout in the root element and created it, but it appears as shown in the picture above. I looked it up, and they told me to add one more line to the module-level gradle I added it like a picture and pressed the Sync Project with Gradle Files button, but it's still the same. We couldn't create guidelines, so we can't proceed Help me.<

android-studio android layout xml

2022-09-22 19:19

1 Answers

There is already a constraint layout in the Grades dependency part.

But in the first picture, you see Android... Constraint Layout on a gray background. Go to the text editor part of the layout xml and

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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">

</androidx.constraintlayout.widget.ConstraintLayout>

Check if it went in safely regarding androidx.

I think you probably used the widget from the previous version of the support layout.


2022-09-22 19:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.