英文:
java.lang.RuntimeException: Error while processing : Fraction values must be in the range 0 to 1: 2.0
问题
<vector android:height="24dp"
android:viewportHeight="512"
android:viewportWidth="512"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<path android:pathData="m405.378,101.962c-41.146,-41.145 -95.851,-63.805 -154.038,-63.805s-112.893,22.66 -154.038,63.805c-41.144,41.145 -63.804,95.85 -63.804,154.038s22.66,112.893 63.804,154.038c41.146,41.144 95.851,63.804 154.038,63.804s112.893,-22.66 154.038,-63.804c41.144,-41.145 63.804,-95.851 63.804,-154.038s-22.66,-112.893 -63.804,-154.038zM251.34,448.314c-106.042,0 -192.314,-86.272 -192.314,-192.314s86.272,-192.314 192.314,-192.314 192.314,86.272 192.314,192.314 -86.272,192.314 -192.314,192.314z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="100" android:startY="100" android:type="linear">
<item android:color="@color/colorAccent" android:offset="0.0"/>
<item android:color="@color/custom_red" android:offset="2.0"/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="m251.34,166.225c18.346,-0 33.272,-14.926 33.272,-33.273 -0,-18.346 -14.926,-33.272 -33.272,-33.272s-33.272,14.926 -33.272,33.272c0,18.347 14.926,33.273 33.272,33.273zM251.34,125.209c4.27,-0 7.744,3.474 7.744,7.744s-3.474,7.744 -7.744,7.744 -7.744,-3.474 -7.744,-7.744c-0,-4.27 3.474,-7.744 7.744,-7.744z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="100" android:startY="100" android:type="linear">
<item android:color="@color/colorAccent" android:offset="1.0"/>
<item android:color="@color/custom_red" android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="m284.612,348.32l-0,-133.336c-0,-18.346 -14.926,-33.272 -33.272,-33.272l-20.508,0c-18.347,0 -33.273,14.926 -33.273,33.272 0,13.827 8.478,25.711 20.509,30.726l0,133.337c0,18.346 14.926,33.273 33.272,33.273l20.508,-0c18.347,-0 33.273,-14.926 33.273,-33.273 -0.001,-13.827 -8.479,-25.711 -20.509,-30.727zM271.847,386.79l-20.508,0c-4.27,0 -7.744,-3.474 -7.744,-7.744l-0,-143.555c-0,-7.049 -5.715,-12.764 -12.764,-12.764 -4.27,0 -7.744,-3.474 -7.744,-7.744s3.474,-7.744 7.744,-7.744l20.508,-0c4.27,-0 7.744,3.474 7.744,7.744l0,143.555c0,7.049 5.715,12.764 12.764,12.764 4.27,-0 7.744,3.474 7.744,7.744 -0.001,4.271 -3.475,7.744 -7.744,7.744z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="200" android:startY="10" android:type="linear">
<item android:color="@color/colorAccent" android:offset="0.0"/>
<item android:color="@color/custom_red" android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
</vector>
英文:
The minSDK was 27 and that was fine but now I am set minSDK 21 and return error :
java.lang.RuntimeException: Error while processing : Fraction values must be in the range 0 to 1: 2.0
<vector android:height="24dp"
android:viewportHeight="512"
android:viewportWidth="512"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<path android:pathData="m405.378,101.962c-41.146,-41.145 -95.851,-63.805 -154.038,-63.805s-112.893,22.66 -154.038,63.805c-41.144,41.145 -63.804,95.85 -63.804,154.038s22.66,112.893 63.804,154.038c41.146,41.144 95.851,63.804 154.038,63.804s112.893,-22.66 154.038,-63.804c41.144,-41.145 63.804,-95.851 63.804,-154.038s-22.66,-112.893 -63.804,-154.038zM251.34,448.314c-106.042,0 -192.314,-86.272 -192.314,-192.314s86.272,-192.314 192.314,-192.314 192.314,86.272 192.314,192.314 -86.272,192.314 -192.314,192.314z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="100" android:startY="100" android:type="linear">
<item android:color="@color/colorAccent" android:offset="0.0"/>
<item android:color="@color/custom_red" android:offset="2.0"/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="m251.34,166.225c18.346,-0 33.272,-14.926 33.272,-33.273 -0,-18.346 -14.926,-33.272 -33.272,-33.272s-33.272,14.926 -33.272,33.272c0,18.347 14.926,33.273 33.272,33.273zM251.34,125.209c4.27,-0 7.744,3.474 7.744,7.744s-3.474,7.744 -7.744,7.744 -7.744,-3.474 -7.744,-7.744c-0,-4.27 3.474,-7.744 7.744,-7.744z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="100" android:startY="100" android:type="linear">
<item android:color="@color/colorAccent" android:offset="1.0"/>
<item android:color="@color/custom_red" android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path android:pathData="m284.612,348.32l-0,-133.336c-0,-18.346 -14.926,-33.272 -33.272,-33.272l-20.508,0c-18.347,0 -33.273,14.926 -33.273,33.272 0,13.827 8.478,25.711 20.509,30.726l0,133.337c0,18.346 14.926,33.273 33.272,33.273l20.508,-0c18.347,-0 33.273,-14.926 33.273,-33.273 -0.001,-13.827 -8.479,-25.711 -20.509,-30.727zM271.847,386.79l-20.508,0c-4.27,0 -7.744,-3.474 -7.744,-7.744l-0,-143.555c-0,-7.049 -5.715,-12.764 -12.764,-12.764 -4.27,0 -7.744,-3.474 -7.744,-7.744s3.474,-7.744 7.744,-7.744l20.508,-0c4.27,-0 7.744,3.474 7.744,7.744l0,143.555c0,7.049 5.715,12.764 12.764,12.764 4.27,-0 7.744,3.474 7.744,7.744 -0.001,4.271 -3.475,7.744 -7.744,7.744z">
<aapt:attr name="android:fillColor">
<gradient android:endX="300" android:endY="600"
android:startX="200" android:startY="10" android:type="linear">
<item android:color="@color/colorAccent" android:offset="0.0"/>
<item android:color="@color/custom_red" android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
</vector>
答案1
得分: 1
尝试将以下行更改为:
<item android:color="@color/custom_red" android:offset="1.0"/>
英文:
Try to change the line
<item android:color="@color/custom_red" android:offset="2.0"/>
into
<item android:color="@color/custom_red" android:offset="1.0"/>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论