2

我正在使用 ionic 框架版本 1.7.14 创建一个 android 应用程序。我正在尝试按照此处提到的步骤生成图标和启动画面。

我在项目的根目录下创建了一个“资源”目录,并在其中添加了 2 个图像:icon.png (192x192) 和 splash.png (2208x2208)。现在当我跑

$ ionic resources

它在资源中生成目录“android”,其中包含子目录“icon”和“splash”。但是,没有生成图像。所有目录都是空的,并且在构建项目时出现以下错误:

Android project created with cordova-android@5.1.1
cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-ldpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-mdpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-hdpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-xhdpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-xxhdpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/icon/drawable-xxxhdpi-icon.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-ldpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-mdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-hdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-xhdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-xxhdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-land-xxxhdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-ldpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-mdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-hdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-xhdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-xxhdpi-screen.png

cp: no such file or directory: /myprojects/testApp/resources/android/splash/drawable-port-xxxhdpi-screen.png
4

4 回答 4

3

ionic cordova resources取决于离子服务器,可能由于网络问题或离子服务器问题而失败。只需确认图标和启动文件已放入PROJECT_FOLDER/resources,然后重试。希望这会对您有所帮助,如果没有,也许您可​​以重新安装 ionic。

于 2016-03-13T12:19:21.407 回答
3

据我所知,您不必创建资源文件夹。它是默认创建的: ionic start myapp [template]

离子资源--icon(创建图标)

离子资源--splash(创建飞溅)

您必须替换资源文件夹中的默认 icon.png 和 splash.png 并确保它们具有正确的指定尺寸。

如果这些不起作用,请尝试再次删除并添加 android 或 ios 平台。

于 2016-03-13T11:26:46.540 回答
0

你说:

我创建了一个目录“资源”

那么这就是你的问题所在。resources不是resource。_

只需将icon.pngandsplash.png放在资源文件夹中并运行ionic resources.

于 2016-03-13T13:21:49.593 回答
0

我有同样的问题。就我而言,原因是非二次飞溅图像。(无缘无故的图形人让我用 2208x2205 引起了轰动)

我将图像更改为 2205x2205 并且它可以正常工作。

于 2016-10-01T08:49:49.533 回答