cordova-icon utility throws error "spawn convert ENOENT" - android

I'm developing an Android/iOS Cordova app. Given the sheer number of icons I should manually create and set into the config.xml, I decided to user this nice tool cordova-icon. It isn't a Cordova plugin, it's just an npm tool which takes your icon.png 1024x1024 and creates all the icon set for Android and iOS, plus it sets the appropriate configuration inside the config.xml file.
Unfortunately I get this error:
And I have no idea why. The icon.png is found, the config.xml is found. Platforms Android and iOS are also found.

I just found the error, I didn't have the image-magick library installed.
I simply had to install it...
$ brew install image-magick
... and then it worked

For one reason or another, that plugin stopped working for me, so I've since switched to app-icon and it has worked like a charm!

Related

How to set icon in Cordova?

I know this question gets asked a lot, and I'm still having trouble getting the icons to show in my app on ios and android after upgrading my platforms.
cordova --version | 9.0.0 (cordova-lib#9.0.1)
cordova platforms | android 8.1.0 ios 5.0.1
Following this https://cordova.apache.org/docs/en/latest/config_ref/images.html my first attempt was to add: <icon src="res/icon.png" /> After building the app I see the images Images.xcassets/AppIcon.appiconset. But the images do not take in the app.
Next I generated all the necessary icon sizes and loaded them in res/icon/android and res/icon/ios and then added the following the icon references to the config.xml from the guide above.
Run cordova build ios and then I see the images Images.xcassets/AppIcon.appiconset folder. However still my icon is not set when I run the app in the simulator.
When I run cordova build android I get a build error: AAPT: error: resource mipmap/ic_launcher (aka com.project.mine:mipmap/ic_launcher) not found.
Any ideas?
Edit: If I got into Xcode General -> App Icon Source and click the arrow to access App Icon. I see the option to manually drag all my icons to the right spot. I see all my icons have a warning: "The app icon set "AppIcon" has 22 unassigned children". It looks like I can resize my images manually and drag them correctly.
I'm wondering if there is a automatic way to do this?
Next I generated all the necessary icon sizes and loaded them in res/icon/android and res/icon/ios and then added the following the icon references to the config.xml from the guide above.
Did you do that by hand? 😱
There's a package that does it all for you.
npm install -g cordova-res
cordova-res
You need the following file structure:
resources/
β”œβ”€β”€ icon.png
└── splash.png
config.xml
Also: in Android, the icon is cached sometimes. You have to either restart your launcher or the phone. (maybe cleaning the app cache works too)

Ionic no splash and icon after SDK update

I didn't change anything except updating the SDK. After I removed and added the platform, it builds with default ionic icon and splash.
I tried also making a new project, and generating only splash and icon for it, and same thing happens...images get generated, they are in folders they need to be, and paths in config are right.
Does anyone have a suggestion?
EDIT: Everything gets compiled with JDK 1.8.0_101
check out this link:
https://github.com/driftyco/ionic-cli/issues/1608
and specifically florentsuc's comment
i solved it by running:
ionic platform remove android
ionic platform add android#6.1.0

Ionic app icon doesn't change

I'm building an android app with Visual Studio 15 Community, Ionic and Apache Cordova and I would like to update the icon of my ionic app. I'm emulating the app with Genymotion but I get the same result using the build-in android emulator from VS15.
Additionally, I used a blank ionic project.
I've already tried
I added the source of my icon in the config file (please note that I added the density myself, it has not been generated)
<icon src="resources/android/icon/icon.png" density="xxxhdpi" />
Created the app logo based on this blueprint:
http://ionicframework.com/docs/cli/icon-splashscreen.html
Placed the .png file in the specific folder
I followed the instructions from the ionic and visual studio website
with no results.
I didn't try
Actually, I didn't try to execute the command to update my ressources using $ ionic resources --icon because I think that as soon as I build the app (pressing the play button in VS15) it does all the work for me
Maybe I'm getting something wrong here because usually this isn't a big deal.
I really appreciate all your answers, thank you for taking the time to deal with this!
As of the latest updates. if the splash and the icon did not update. that is because the latest version of ionic creates 2 md5 files of the icon and the splash. which i guess is locking the updates.
just delete these 2 files: β€œicon.png.md5” and β€œsplash.png.md5”.
then run the following command : ionic cordova resources
then splash and the icon should be updated.
might be helpful to someone out there cheers!!
Density is set to "xxxhdpi" density. Maybe you need to add another screen options?
Try to refresh project, too.
As mentioned earlier by a user whos post has been deleted (why?), all I had to do was to
open my command line
go to the directory in which my project is
type the command $ ionic resources
That's it! Ionic does all the rest
A quick note: I didn't know that I had to install the tools (Android SDK, Apache Cordova etc.) because I thought that Visual Studio downloads them due to the first build so why installing it locally. You must install them locally, it will not work without the tools installed on your machine.
Hope I could help

Cordova - run app in device and icon

When I run
cordova run android
in my cordova project, it installs ok the app in the device. But the icon used is still the default one from cordova, not the one defined in config.xml (in the root folder
For testing, I changed all the original icon.png in /platforms/android/res folders, changing it to the one I want, but the installed app still uses the old one.
Is this the normal behaviour? When the final .apk is built, the package will use the right icon? Or is this my fault?
Running cordova 3.5
UPDATE: found the answer here Generating iOS and Android icons in Cordova / PhoneGap
Using the module https://github.com/AlexDisler/cordova-icon help to copy icons to th write folder(s)

Deploying Phonegap / Cordova app for Android?

I've got a Phonegap/Cordova 3.0 app that I am testing on Android.
Since version 2.x, Cordova relies heavily on the command-line terminal. I've done all the setup stuff and I can build the app. But two things are troubling me.
First of all, an Android project has two www folders. One is [myproject]/www. The other is [myproject]/platforms/android/assets/www. I'm not sure which of these folders to edit when I am fixing bugs.
If I am correct, the first one is where you place your app files before using the command-line "cordova build" to create the app. The second one should then be only a copy that's used after building, before deploying.
Now my question is, when I make a change to my app and I want to test on device, do I have to use the command line to (re)build the app every time?
[myproject]/www is the directory in which you should put your source files. When you build your app these files are copied in to [myproject]/platforms/[platform]/assets/www. In addition to this, files in [myproject]/platforms/[platform] are also copied to [myproject]/platforms/[platform]/assets/www, which allows you to create per-platform overrides to your files.
Note that you should never edit files in [myproject]/platforms/[platform]/assets/www directly, as they will be deleted next time you build your project.
To run your project on your device use cordova run [platform], or to run it on an emulator use cordova emulate [platform].
I found a solution: in command-line terminal, type cordova run android and the app will be built, deployed and run on device.
Hi First thing : Edit www folder inside the asset folder.
Second : no need of command line build , you can take build via eclipse its very easy, Right click on project root folder --> Run As -> Android Application

Categories

Resources