错误:源路径不存在:resourcesandroidicondrawable-hdpi-icon.png [英] Error: Source path does not exist: resourcesandroidicondrawable-hdpi-icon.png

查看:29
本文介绍了错误:源路径不存在:resourcesandroidicondrawable-hdpi-icon.png的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Mac 上使用cordova build --release android"命令从 Ionic 项目获取 APK 文件,但它不起作用当我收到此错误时

I'm trying to get an APK file from a Ionic project with the "cordova build --release android" command on a Mac and it doesn't work as I get this error

"错误:源路径不存在:资源androidicondrawable-hdpi-icon.png"

"Error: Source path does not exist: resourcesandroidicondrawable-hdpi-icon.png"

.有谁知道它可能来自哪里?

. Anyone knows where it might come from?

这是 config.xml 文件的副本:

Here is the copy of the config.xml file :

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.rise268787" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>RISE</name>
<description>
    Discover music as you go
</description>
<author email="infos@olivierlam.fr" href="http://olivierlam.fr/">
  Olivier Lam
</author>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="SplashScreen" value="screen" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreenDelay" value="1000" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="1000" />
<feature name="StatusBar">
    <param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<platform name="android">
    <preference name="android-minSdkVersion" value="23" />
    <preference name="android-targetSdkVersion" value="23" />
    <icon density="ldpi" src="resourcesandroidicondrawable-ldpi-icon.png" />
    <icon density="mdpi" src="resourcesandroidicondrawable-mdpi-icon.png" />
    <icon density="hdpi" src="resourcesandroidicondrawable-hdpi-icon.png" />
    <icon density="xhdpi" src="resourcesandroidicondrawable-xhdpi-icon.png" />
    <icon density="xxhdpi" src="resourcesandroidicondrawable-xxhdpi-icon.png" />
    <icon density="xxxhdpi" src="resourcesandroidicondrawable-xxxhdpi-icon.png" />
    <splash density="port-ldpi" src="resourcesandroidsplashdrawable-port-ldpi-screen.png" />
    <splash density="port-mdpi" src="resourcesandroidsplashdrawable-port-mdpi-screen.png" />
    <splash density="port-hdpi" src="resourcesandroidsplashdrawable-port-hdpi-screen.png" />
    <splash density="port-xhdpi" src="resourcesandroidsplashdrawable-port-xhdpi-screen.png" />
    <splash density="port-xxhdpi" src="resourcesandroidsplashdrawable-port-xxhdpi-screen.png" />
    <splash density="port-xxxhdpi" src="resourcesandroidsplashdrawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
    <icon height="57" src="resources/ios/icon/icon.png" width="57" />
    <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
    <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
    <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
    <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
    <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
    <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
    <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
    <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
    <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
    <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
    <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
    <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
    <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
    <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
    <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
    <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
    <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
    <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
    <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
    <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
    <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
    <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
    <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
    <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
</platform>
<icon src="resources/ios/icon/icon-small@3x.png" />
<plugin name="cordova-plugin-facebook4" spec="~1.7.1">
    <variable name="APP_ID" value="XXXXXXX" />
    <variable name="APP_NAME" value="Rise" />
</plugin>
<allow-intent href="mailto:*" />
<allow-navigation href="*.youtube.com" />
<plugin name="cordova-plugin-whitelist" spec="~1.2.2" />

感谢您的帮助.

推荐答案

运行后出现同样的错误

离子资源

或者

离子科尔多瓦资源

(基于您的应用程序的离子版本)

(Based on the ionic version of your application)

它消失了.

问题是我在图标的路径中有 Windows 风格的斜杠(反斜杠),即我遇到的错误是这样的:

The problem was that I had Windows-style slashes (backslashes) in the path of the icon, i.e. the error I had was this:

错误:源路径不存在:资源androidicondrawable-hdpi-icon.png

Error: Source path does not exist: resourcesandroidicondrawable-hdpi-icon.png

因此,将反斜杠转换为斜杠为我解决了这个问题.

So, converting backslashes into slashes resolved it for me.

希望这对您和其他寻找相同问题的人有所帮助.这一切都是因为使用不同的机器[mac &windows] 用于mac和windows等项目的开发.

Hope this help to you and the others looking for same problem. It all happens because using different machines[mac & windows] for development of project like mac and windows.

这篇关于错误:源路径不存在:resourcesandroidicondrawable-hdpi-icon.png的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆