Lokesh Sardana Lokesh Sardana - 1 month ago 11
Android Question

Ionic Framework: 'ionic resources' generating empty directories with no icon and splash images

I am using ionic framework version 1.7.14 to create an android app. I am trying to generate icon and splash screen by following the steps mentioned here.

I have created a directory 'resources' at the root of my project and added 2 images: icon.png (192x192) and splash.png (2208x2208) in that. Now when I run

$ ionic resources


It generates the directory 'android' in resources with subdirectories 'icon' and 'splash' in it. But, there are no images generated. All directories are empty and I get following error while building the project:

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

Answer Source

ionic resources depends on ionic server and could be failed because of network issues or ionic server issues. Just confirm that icon and splash files are put into PROJECT_FOLDER/resources, and try again. Hope this will help you, if not, maybe you could reinstall ionic.