728x90

1. 현상

- Migrate to AndroidX로 변경을 하는데...

  정식 서비스 앱에서는 제대로 잘 변경되었는데, 문제가 터진건 토이프로젝트였음.

  Migration을 잘못한건지 xml에서 이전 그대로 따라가고 잘못 꼬여있었다.

 

2. 수정 경로

 

* AppBarLayout

수정전: android.support.design.widget.AppBarLayout

수정후: com.google.android.material.appbar.AppBarLayout

 

* Toolbar

수정전: android.support.v7.widget.Toolbar

수정후: androidx.appcompat.widget.Toolbar

 

* CoordinatorLayout

수정전: androidx.constraintlayout.ConstraintLayout 

수정후: androidx.coordinatorlayout.widget.CoordinatorLayout

 

android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.ConstraintLayout

 

 

* ConstraintLayout

수정전: androidx.constraintlayout.ConstraintLayout

수정후: androidx.constraintlayout.widget.ConstraintLayout

 

* FloatingActionButton

수정전: android.support.design.widget.FloatingActionButton
수정후: com.google.android.material.floatingactionbutton.FloatingActionButton

   Caused by: android.view.InflateException: Binary XML file line #12: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton
     Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton
     Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.FloatingActionButton" on path: DexPathList[[zip file ~~

 

* CardView

수정전: android.support.v7.widget.CardView
수정후: androidx.cardview.widget.CardView

 

* TabLayout

수정전: android.support.design.widget.TabLayout

수정후: com.google.android.material.tabs.TabLayout

 

* TabItem

수정전: android.support.design.widget.TabItem

수정후: com.google.android.material.tabs.TabItem

 

* TextInputLayout

수정전: android.support.design.widget.TextInputLayout

수정후: com.google.android.material.textfield.TextInputLayout

 

* TextInputEditText

수정전: android.support.design.widget.TextInputEditTextt

수정후: com.google.android.material.textfield.TextInputEditText

 

 

* ViewPager

수정전: androidx.core.view.ViewPager

수정후: androidx.viewpager.widget.ViewPager

     Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class androidx.core.view.ViewPager
     Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class androidx.core.view.ViewPager

 

Reference:

https://stackoverflow.com/questions/55298742/android-error-inflating-class-android-support-design-widget-appbarlayout

https://stackoverflow.com/questions/42221530/error-inflating-class-android-support-design-widget-floatingactionbutton

728x90

+ Recent posts