Error inflating class android.support.constraint.ConstraintLayout和 Error inflating class android.sup

Error inflating class android.support.constraint.ConstraintLayout

After updating to androidx, running the program prompts me
Insert picture description here

Navigate to
Insert picture description here

The reason is that after I updated from the V7 package to androidx, the reference path of ConstraintLayout of the layout file referenced in the original setcontentview changed

So after changing android.support.constraint.ConstraintLayout to androidx.constraintlayout.widget.ConstraintLayout, the problem is solved
Insert picture description here

Error inflating class android.support.v4.view.ViewPager

Error message

Insert picture description here

What went wrong

Insert picture description here

How to change

Say that the following tags are the same as the packages introduced in mainactivity

<android.support.v4.view.ViewPager   
    >
    </android.support.v4.view.ViewPager>

Insert picture description here

Modified result

Insert picture description here

operation result

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41827511/article/details/105782185