티스토리 뷰

728x90

 

 

Failed to compile values file. Resource compilation failed. Check logs for details.

Illegal char <:> at index app-mergeDebugResources-70:/values/values.xml

 

resources 파일을 컴파일하면서 생기는 에러인데 따로 빨간줄이 쳐지는게 없어서 찾기 오래걸린다;;

보통 strings, themes, colors, attrs 등 xml 파일에 오타가 나면 발생한다.

 

 

1) colors.xml

    <color name="yellow">##FFCC02</color>

위처럼 #을 두개 작성하거나 컬러 코드가 7자리인 경우 오류가 발생한다.

 

 

2) attrs.xml

    <declare-styleable name="CustomView">
        <attr name="title" format="reference|string" />
        <attr name="height" format="reference|integer" />
    </declare-styleable>

커스텀뷰에 커스텀 속성을 추가할 때, 속성 이름이 이미 존재하는 속성 이름인 경우 발생한다.

나는 height 속성을 지정했는데 이미 존재하는 속성이기 때문에 오류가 발생했다.

 

 

3) strings.xml

    <string name="title">'따옴표'</string>
    <string name="title">\'따옴표\'</string>

string 태그 안에 '를 사용해야 하는 경우 ' 앞에 \를 사용해야 한다.

 

 

 

 

https://stackoverflow.com/questions/64296448/failed-to-compile-values-file

728x90
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함