Ionic build not reflecting changes when running or deploying to app - node.js

I am using the standard ionic template project that is generated from by WebStorm.
When I make simple changes (like adding a test alert(...)) in app.run(...) in app.js and run the following set of commands, the changes are not reflected when the app runs or is deployed to the phone.
The following commands are ran from the root of my project.
gulp
ionic build android
ionic run|emulate android
Is there something I am missing that would not reflect the changes I am making?

Recently experienced this issue. What helped me is removing the android platform:
ionic platform rm android
then, re-adding it.
ionic platform add android
make sure you delete the app from your device before running/installing again, then run:
ionic run android
hope this helps

So I was able to determine why this issue was occurring.
As I was testing on my android phone (Galaxy to be specific), everytime I would run the following command...
ionic run android
It would appear to deploy/install to my device, and it would open up the app. Howevever, it wasn't actually deploying the newest version as I was already running the previous version in the background.
The fix for this was to make sure that the application was not running (in foreground or background). This required me to make sure that if it was running, that I stop it before testing any changes.

Faced the same issue after upgrading cordova and ionic to the latest versions.
ionic info
Downgraded cordova and ionic versions to match my previous environment, it started taking the changes all over again.
commands:
npm install -g cordova#6.2.0
npm -d install -g ionic#2.0.0-beta.35
Everything works well with the following combination for me.
Hope this helps someone!!!

Just remove all files inside www folder and run ionic lab to update then, for some reason when I run cordova run android the version deployed was the old one, but when I remove the files in www folder the new version was deployed.

Related

could not build apk or run it on to a device

i was able to build and test apk on to my device by cordova run android,
now suddenly it got stuck could someone help me to fix this issue, i waited almost for 20 min but no changes.
This image has my ionic info and my build part
I reinstalled platform, updated android studio, npm cache clean. but nothing success full.
I think there is something wrong with the gradle, maybe it is being downloaded, which take forever..
You might wanna mannually download the gradle and specify the downloaded path in yout_app_directory/platforms/android/cordova/builders/GradleBuidler.js => maybe somewhere around line 202 var distributionUrl = 'your_gradle_path'
Follows this
cordova platform rm android
Cordova platform add android
Open emulator or connect Device to the system then
Cordova run android
This will help you .
use command 'ionic cordova run android'
or
Update node version. The version you are using is 6.11.0 but ionic is 3.5.0. so please update node version and check again
or
If you are not using ionic3, then you can downgrade your ionic version using a command 'npm install -g ionic#2.2.0'. then use 'ionic run android'

Error while starting a blank app with Ionic framework

I recently installed ionic framework.
My laptop already had GIT, node and npm installed and all of them have been updated to latest.
When running ionic start my IonicApp1 tabs following the Get Started instruction on their website, I ran into the following error and this stopped from creating the app.
Any idea? Thanks!
Ionic recently changed its cli try ionic start myproject blank --type ionic1 for a blank demo app

Default Install Location: IONIC, NODEJS

I came accross an issue today, when i installed ionic and cordova for a test project. i did this
npm install -g cordova ionic
then
ionic start myapp tabs
Problem that i faced was that nothing happened, i searched around but could not find a reasonable answer. this is what i found:
http://stackoverflow.com/questions/27155486/ionic-start-projectname-not-working-with-ionic-framework
https://forum.ionicframework.com/t/ionic-start-myapp-tabs-not-working/3205
But i believed it is an environment issue. So i cleanedup. removed old builds and did a fresh build but nothing much of success.
Questions:
1) Where is default location for creating the app folder is defined when we do 'start ionic app-name'
2) If app-name folder is not created and command completes without any errors, what should be next course of action.
i hope some one can help out.
ENV: WINDOWS7, NODE.JS, IONIC, CORDOVA
I solved my problem (stated above) by upgrading node.js and reinstalling ionic package after removing it.
Second i also found out that to specify path to app location, below command will work.
ionic start [absolute-path-to-app-folder] [template-optional]
e.g.
ionic start c:\myApp will create a blank app in C drive
Hope this can help someone. i spent a week digging this out.

How to completely uninstall Cordova

since I updated my mac to Sierra I noticed a strange behaviour in my cordova app: some plugins aren't working anymore, it just seems they are not copied in the ios platform even if when I add the Platform the plugins' folders are copied as usual. It just seems xcode ignore them.
I tried a few things: removing and adding again plugins, updating cordova, uninstalling and reinstalling cordova, updating platforms, trying creating a brand new app... nothing seems to fix the problem.
Searching around I found this command:
$ cordova platform update ios --save
and it worked without doing anything else.
Unfortunately I have to use this command everytime I make a change in the app and I remove and add the platform again so I guess it's a problem in my environment.
I would like to completely uninstall cordova, node.js and git and reinstall everything again. I found a few instructions like in this question for node.js How do I uninstall nodejs installed from pkg (Mac OS X)? but I don't know how to run correctly all of the commands, some of them fail.
Uninstalling cordova and reinstalling works but doesn't solve the problem.
I did it with
$ sudo npm install -g cordova
$ sudo npm uninstall -g cordova
Can someone link me where to find clear instructions step by step? I'm not that good with command line and I really want to fix this problem without formatting the whole system.
Thank you for any help!
Think I have the solution: I removed cordova,
sudo npm uninstall -g cordova
deleted the .cordova folder in my user home folder (it's a hidden folder!) and installed cordova again with
sudo npm install -g cordova
I noticed that one of my old cordova projects was working: remove platform, add platform and by default I had ios platform version 4.3.0. GOOD!
In another cordova project created after latest update it was still using ios platform 4.2.1.
In the root project folder there is the config.xml file and in this file I found this line in just the second project:
<engine name="ios" spec="~4.2.1" />
Just removed and now cordova is using by default the latest version of the ios platform.
I don't know exactly why in one project there was this line and why not in the other one... neither know if I updated the platform in one project before reinstalling cordova and after reinstalling in onther... can't remember.
I just know that now if I create a new project it's correctly using ios platform 4.3.0 and I tried to describe all my steps...
I hope it will be useful for anyone else because I was ready to format my mac to fix this :(
I don't think you really have a problem with node or npm.
It seems to me more the kind of problem that happen when you change your node version without rebuilding node_modules directory.
If you always install modules with --save modifier, try this:
rm -rf node_modules
npm install
...if not, you can make a backup of your node_modules first. But it will be useful only to inspect it to figure out what modules are missing in your 'package.json' file.

How to update sencha cordova version

Trying to build a sencha project with:
sencha app refresh
sencha app build package
It is usually built on another machine that's unavailable right now.
I can see one of the things that has changed is in cordova.js: from:
CORDOVA_JS_BUILD_LABEL = 3.3.0 to:
CORDOVA_JS_BUILD_LABEL = 3.0.0-0-ge670de9
So this newer build machine is on an outdated version of cordova it appears.
So I ran npm install cordova -g to update it.
But it builds the same. What needs updating and how do I do this?
With npm you update the cordova binaries, but not the existing Cordova projects. In order to update the iOS/Android/WP/... projects, go into your main cordova project folder (in your case, the cordova folder inside your Sencha app) and execute:
cordova platform update ios
Replace ios for the platform you want to update. If you have several target plaforms, run the command once for each one.
I would recommend you to update all the plugins after the upgrade. For that, run:
cordova plugin list
in the same folder as before, and do a
cordova plugin remove plugin_name
cordova plugin add plugin_name
for each plugin that you are currently using.

Resources