未找到AndroidManifest.xml通知图标
我的颤振项目中有一个透明/白色图标: #项目#/android/app/src/main/res/drawable/android#u notification_icon.png 在我的AndroidManifest.xml中,我有以下内容:未找到AndroidManifest.xml通知图标,android,flutter,Android,Flutter,我的颤振项目中有一个透明/白色图标: #项目#/android/app/src/main/res/drawable/android#u notification_icon.png 在我的AndroidManifest.xml中,我有以下内容: <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource=
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/android_notification_icon.png" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notificationIconColor" />
但我得到了这个错误:
AndroidManifest.xml:55:AAPT:error:resource drawable/android_notification_icon.png(又名dk.myapp.debug:drawable/android_notification_icon.png)找不到
为什么找不到我的android_notification_icon.png
谢谢你瑟伦 xml:55:AAPT:error:resource drawable/android_notification_icon.png(又名 dk.myapp.debug:drawable/android_notification_icon.png)未找到 你应该使用
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/android_notification_icon" />
这将关闭APK中任何非9patch png文件的AAPT
png优化
最后,
清理重建运行
android:resource=“@drawable/android\u notification\u icon”
确保png正确或无效是的,谢谢你在哪里添加。。。aaptOptions{cruncherEnabled=false}它不是XML,所以我认为它不会出现在AndroidManifest中。。。我应该把这个放在哪里?@PrimeByDesign放在你的build.gradle
部分。太棒了,成功了!!非常感谢。☺️
android {
...
aaptOptions {
cruncherEnabled = false
}
....
}