gpt4 book ai didi

android - 尝试使用自适应图标构建 cordova 应用程序时出错

转载 作者:太空狗 更新时间:2023-10-29 16:38:26 24 4
gpt4 key购买 nike

当尝试在 config.xml 中添加自适应图标时,我在尝试构建时遇到以下错误

One of the following attributes are set but missing the other for the density type: ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi. Please ensure that all require attributes are defined.

我的代码是:

<platform name="android">
<resource-file src="res/icon/android/colors.xml" target="/app/src/main/res/values/colors.xml" />
<icon background="@color/background" density="ldpi" foreground="res/icon/android/ldpi-foreground.png" />
<icon background="@color/background" density="mdpi" foreground="res/icon/android/mdpi-foreground.png" />
<icon background="@color/background" density="hdpi" foreground="res/icon/android/hdpi-foreground.png" />
<icon background="@color/background" density="xhdpi" foreground="res/icon/android/xhdpi-foreground.png" />
<icon background="@color/background" density="xxhdpi" foreground="res/icon/android/xxhdpi-foreground.png" />
<icon background="@color/background" density="xxxhdpi" foreground="res/icon/android/xxxhdpi-foreground.png" />
</platform>

我正在使用 cordova-android 8.0.0

最佳答案

在此处粘贴对同一问题(由同一开发人员提出)的答案以供引用 here .

@Fmaldonado6 After some digging through the code I found that it was because I was using global cordova cordova@8.1.2, upgrading to cordova@9.0.0 via npm i -g cordova@9.0.0 fixed the problem for me. This is because even though we upgraded to cordova-android@8.0.0 in our project this library depends on information passed to it from the globally installed cordova library which it gets from cordova-common@3.1.0 whereas cordova@8.1.2 has cordova-common@2.2.5 which does not pass along foreground and background props

关于android - 尝试使用自适应图标构建 cordova 应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55232764/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com