Published May 28, 2020
Share this article
Recent Posts
I migrated an Android app to AndroidX with the help of the Refactor option from Android Studio. After all the references in the java files were updated, I ran into the below error when I tried running my app.
android.view.InflateException: Binary XML file line #2 in <>: Error inflating class androidx.constraintlayout.ConstraintLayout Caused by: android.view.InflateException: Binary XML file line #2 in <>: Error inflating class androidx.constraintlayout.ConstraintLayout Caused by: java.lang.ClassNotFoundException: androidx.constraintlayout.ConstraintLayout
After a bit of head scratching and internet search, I was able to fix it by simply changing the declaration in the layout XML file. androidx.constraintlayout.ConstraintLayout to androidx.constraintlayout.widget.ConstraintLayout I was expecting atleasst the IDE to throw an error, but had to find and fix it the hard way.
androidx.constraintlayout.ConstraintLayout
androidx.constraintlayout.widget.ConstraintLayout
Home | Privacy Policy | Cookie Preferences | Ae App Labs
© 2022 Midhun Harikumar. All Rights Reserved.