본문 바로가기

프로그래밍, 코딩

안드로이드 앱 프로그래밍 에러 "AAPT: error: '0' is incompatible with attribute layout_height (attr) dimension|enum"

반응형

Do it! 안드로이드 앱 프로그래밍 동영상을 보면서 공부하던 중 아래와 같은 에러 코드가 발생 했다.

 

 

"AAPT: error: '0' is incompatible with attribute layout_height (attr) dimension|enum [fill_parent=4294967295, match_parent=4294967295, wrap_content=4294967294]."

 

 

 

검색해보니, stack overflow에서 그 원인을 알게 되었는데, 원문 link는 아래와 같다.

 

 

https://stackoverflow.com/questions/47482546/android-gradle-build-failed

 

Android Gradle Build Failed

I have been using android studio and there where 17 errors messages after gradle build finished. I always try to rebuild but still same error. Message in Grade Console : Information:Gradle tasks ...

stackoverflow.com

 

 

 

3개의 view의 layout_height을 모두 0으로 설정하고, layout_weight을 1로 모두 설정하고, 각 view가 1/3 씩 차지하게 하는 실습을 하고 있었는데,

 

 

에러 원인은 layout_height을 단순히 숫자 "0"만 넣어서 에러가 발생한 것이다.

 

 

아래와 같이 "0dp"라고 "dp"를 명확히 기재해야 에러가 해결된다.

 

 

반응형