Cordova - run app in device and icon - android

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)

Related

cordova-icon utility throws error "spawn convert ENOENT"

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!

Ionic - Update splash screen doesn't work

I have an ionic app with version 3.12.0 and I'm trying to update the app icon and splash.
I put icon.png and splash.png in resources folder and run:
ionic cordova resources --icon
ionic cordova resources --splash
And it just update the icon and not the splash. In splash shows the old.
After that I remove the android and ios folder from resources and run:
ionic cordova resources
It create well all both folders again with correct icon but with old splash. How can I solve this?
In all commands that I run show me this warning and I don't know if it can be the reason for that, I think not because the icon was well generated and updated.
[WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying
./bower.json.
Thank you
Try this command:
$npm rebuild node-sass --force
after generating splash and icon.
from https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/
"App on target may not reflect changes to images Once you run the app on a target, iOS caches the launch image. Unfortunately, when you change the image, iOS does not invalidate the cache, which means you'll still see the old launch image. You should either: delete the app, or reset content & settings (simulator)."

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 build erases all app files

I have some problem with building an app with cordova. This is my first experience with that software.
I have an existing Android HTML/JS app. I want to do some changes to it, re-build and test it in emulator.
App's files are located in platforms/android/asset/www, I can see them, edit them etc.
Now, after doing the changes, I do a "cordova emulate". I see it builds my app, the emulator starts and… it shows me a Hello World app.
All app's files from asset/www disappeared, and are replaced with "blank", hello world files , like I would just create a new app.
Why is this happening? How to prevent it?
My current cordova version is 4.3.0. The application was probably made and last edited on some older version (few months ago).
Found a similar problem here link but there's no solution there.
Instead of working on the platforms/android/asset/www you have to work on the root www folder, when you run the app the files will be copied to platforms/android/asset/www

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