"java.lang.NoSuchFieldError: ConstraintLayout_Layout_layoutDescription" when I initialize project

Viewed 677

Okay, I create a completely new project with the default template and this is what happens: Failed to in

What is happening? Here is my activity_main.xml:

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

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 Answers

Okay... The result was not as satisfying, but it worked. In the designer, I went to the layoutDiscription field and entered some random number, and then I clicked on the hammer icon and it just works! Now even if I create a new project, it still works. Thanks for all the other questions you guys have answered.

Just rebuild the project and it will be resolved.

Related