Android сбой привязки ресурса '@ colors / blue' несовместим со ссылкой на ресурс атрибута (attr) - PullRequest
0 голосов
/ 02 марта 2020

Android сбой привязки ресурса '@ colors / blue' несовместим со ссылкой на ресурс атрибута (attr).

Я пытаюсь установить пользовательский цвет для firebase pu sh значок уведомления. Это часть моей конфигурации. xml, которая вызывает ошибку несовместимости.

<platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
        </edit-config>
        <config-file parent="./application" target="AndroidManifest.xml" xmlns:android="http://schemas.android.com/apk/res/android">
            <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/push" />
            <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@colors/blue" />
        </config-file>
        <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
        <resource-file src="google-services.json" target="app/google-services.json" />
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <resource-file src="resources/android/push-icon/drawable-mdpi-icon.png" target="app/src/main/res/drawable-mdpi/push.png" />
        <resource-file src="resources/android/push-icon/drawable-hdpi-icon.png" target="app/src/main/res/drawable-hdpi/push.png" />
        <resource-file src="resources/android/push-icon/drawable-xhdpi-icon.png" target="app/src/main/res/drawable-xhdpi/push.png" />
        <resource-file src="resources/android/push-icon/drawable-xxhdpi-icon.png" target="app/src/main/res/drawable-xxhdpi/push.png" />
        <resource-file src="resources/android/push-icon/drawable-xxxhdpi-icon.png" target="app/src/main/res/drawable-xxxhdpi/push.png" />
        <resource-file src="resources/android/xml/colors.xml" target="app/src/main/res/xml/colors.xml" />
    </platform>

И это соответствующая часть моего AndroidManifest. xml

<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@colors/blue" />

И полный маршрут для цветов. xml файл:

resources / android / xml / colors. xml

Целевой сгенерированный маршрут:

app / src / main / res / xml / colors. xml

И, наконец, цвета. xml код файла:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="blue">#38a8ff</color>
</resources>

Спасибо

1 Ответ

1 голос
/ 02 марта 2020

Это должно быть color без s:

android:resource="@color/blue"
...