Android프로그래밍

[안드로이드 빌드오류] Cause: java.lang.IllegalStateException: Cannot find attribute fillColor). Check logs for more details. 해결방법

drawable-anydpi-v24/폴더의 ic_launcher_background.xml 에서 빌드과정에 오류가 발생하였다.

Resource compilation failed (Failed to compile resource file: /Users/test/AndroidStudioProjects/test/app/build/generated/res/pngs/debug/drawable-anydpi-v24/ic_launcher_background.xml: .

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="108"
    android:viewportHeight="108">
    <path
        android:fillColor="#008577"
        android:pathData="M0,0h108v108h-108z" >
        <aapt:attr name="android:fillColor">
            <gradient
                android:type="radial"
                android:centerX="54"
                android:centerY="54"
                android:gradientRadius="76.37">
                <!-- 15% black from center to 32% stop -->
                <item android:offset="0.0" android:color="#26000000" />
                <item android:offset="0.32" android:color="#26000000" />
                <!-- 2% black at 62% stop -->
                <item android:offset="0.62" android:color="#05000000" />
                <!-- fade to transparent -->
                <item android:offset="1.0" android:color="#00000000" />
            </gradient>
        </aapt:attr>
    </path>


</vector>

잘 되던 것들이 안된다는 것은 구글에서 새로운 업데이트 발생했다는 건데…. 벡터 드로어블에서는 fillColor속성을 명시적으로 설정해야 하며 다른 리소스를 참조해서는 안 된다고 하네??

해결방법

<aapt:attr name=”android:fillColor“> 태그를 삭제하였다.

[reference]

https://stackoverflow.com/questions/51325513/cant-process-attribute-androidfillcolor-androidcolor-white

error: Content is protected !!