我正在尝试为运行 Oreo 的设备构建 RRO/覆盖主题,以更改状态栏图标/指示器。
我提取了 AOSP 的状态栏图标并将它们包含在包中,只进行了一次修改:将对内部systemui
包的引用从更改?attr/XXX
为?*com.android.systemui:attr/XXX
. 每次构建时,都会引发以下错误:
\thm\res\drawable\stat_sys_wifi_signal_0.xml:24: error: Error: No resource found that matches the given name (at 'fillColor' with value '?*com.android.systemui:attr/fillColor').
\thm\res\drawable\stat_sys_wifi_signal_0.xml:27: error: Error: No resource found that matches the given name (at 'fillColor' with value '?*com.android.systemui:attr/backgroundColor').
我正在使用命令行来构建我的 APK,这是我的文件设置:
./AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.theme.aospstatusbar">
<overlay
android:priority="1"
android:targetPackage="com.android.systemui"
</manifest>
以下文件是我包含在包中的可绘制对象的示例,上面的错误示例指的是:
./res/drawable/stat_sys_wifi_signal_0.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18.41dp"
android:height="18.41dp"
android:viewportWidth="21.2"
android:viewportHeight="21.2">
<group
android:translateX="0.5"
android:translateY="2.0">
<path
android:pathData="M18.79,9.79c-0.32,-0.32 -0.83,-0.32 -1.15,0L16.43,11l-1.21,-1.21c-0.32,-0.32 -0.83,-0.32 -1.15,0L14.06,9.8l0,0c-0.32,0.32 -0.32,0.83 0,1.15l1.21,1.21l-1.21,1.21l0,0c-0.32,0.32 -0.32,0.83 0,1.15l0.01,0.01c0.32,0.32 0.83,0.32 1.15,0l1.21,-1.21l1.21,1.21c0.32,0.32 0.83,0.32 1.15,0c0.32,-0.32 0.32,-0.83 0,-1.15l-1.21,-1.21l1.21,-1.21C19.1,10.64 19.1,10.13 18.79,9.79z"
android:fillColor="?*com.android.systemui:attr/fillColor"/>
<path
android:pathData="M11.69,7.44h6.27L19.95,5c0.4,-0.49 0.3,-1.22 -0.23,-1.56c-1.6,-1.05 -5.04,-2.9 -9.62,-2.9c-4.59,0 -8.03,1.85 -9.62,2.9C-0.05,3.78 -0.16,4.51 0.24,5l9.02,11.08c0.42,0.52 1.22,0.52 1.64,0l0.78,-0.96V7.44z"
android:fillColor="?*com.android.systemui:attr/backgroundColor"/>
</group>
</vector>
我使用以下命令(aapt
在build-tools\26.0.3
)构建:
aapt package -M \thm\AndroidManifest.xml -S \thm\res -I %sdk%\platforms\android-26\android.jar -F \thm\build\overlay.apk -f
我相信问题出在从systemui
包中引用?难道我做错了什么?