플랫폼: 안드로이드 스튜디오(Android Studio)
오류 현상: InflateException-UnsupportedOperationException type 3으로 인한 어플리케이션 강제 종료
android.view.InflateException: Binary XML file line #16: Binary XML file line#16: Error Inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 2 to dimention: type=0x3
사유: android:textSize 값을 dimen 타입으로 주지 않고 string type으로 줘서 생긴 오류. 이외에도 dimention 타입으로 줘야하는 값을 다른 타입으로 주면 xml 분석이 안 돼서 view inflate가 안 됩니다.
왜 이런 코딩을 했느냐 한다면, 앱 전체의 폰트 사이즈를 변경하는 방법을 찾아보다가 string.xml에 넣어서 할 수는 없을까? 라는 헛된 생각을 했고... listview를 inflate 하기 전까지는 오류가 있는 줄도 모르다가 그렇게 되었습니다.
type 3이라는 거 보니 다른 문제 타입도 있는 듯함.
해결책: xml에 dimen 값(dp 등)을 줍시다.
그외 시도 방법:
'Android Studio' 카테고리의 다른 글
[안드로이드 스튜디오] textview.setText()에 int, double형 데이터를 입력해야 할 때 (0) | 2022.03.11 |
---|---|
[안드로이드 스튜디오] avd(Emulator)가 오류 메시지 없이 먹통일 때 (0) | 2021.10.03 |