How to update sencha cordova version - node.js

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.

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'

Unable to add plugins to cordova project. npm error?

I have a Cordova application and want to add a plugin to my Cordova project. It worked yesterday!
What I did:
Updated Android Studio to 3.x
Updated Cordova
If I want use the cordova add command, I get this error:
What should I do?
Hard Reset it: Try to remove that plugin you installed yesterday, maybe do a clean install of Cordova or update all dependencies and add missing through Gradle and then finally go for installing the plugins. Somehow, I feel that Cordova version or some dependency mismatch is giving birth to such problems.

Ionic setup issues on Windows 7

I am trying to install Ionic on Windows 7 machine.
First, installed NodeJS 6.1.0, It went fine
Then, ran npm install -g cordova, Went fine
Then, ran npm install -g ionic, Got error related to Python.
Installed Python 2.7
Again, ran npm install -g ionic, Got error related to Microsoft .Net
Framework 2 SDK.
Updated npm to 3.8.9, Still getting error related to Microsoft .Net
Framework 2 SDK.
Are Python and Microsoft .Net SDK actually required? Nowhere I could find about this in the installation guides.
no python and .net SDK are not required
you need to download Android SDK in the case of developing for android.
you can download android studio and download SDK from SDK MANAGER or simply download android SDK. In my case, I download the android studio and then used the SDk manager to download the SDK's.
You can download it from here Android SDK
Also ou need to have JAVA jdk installed on your system and you have to set
PATH for both android sdk , java and nodejs
add PATH in system variables to environment variable
to
C:\Program Files\nodejs\
C:\Users**SystemName**\AppData\Local\Android\android-sdk\tools
C:\Users**SystemName**\AppData\Local\Android\android-sdk\platform-tools
C:\Program Files\Java\jdk1.7.0_79\bin
the above paths are according to my system. The SystemName may differ on your system else will be the same.
You also need to set User Variable jsut above your system variable:
ANDROID_HOME : C:\Users\SystemName\AppData\Local\Android\android-sdk
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_79
you may also need to install gradle using nodejs command
and add its user variable and system variable
like
GRADLE_HOME :C:\Program Files\gradle-2.9
same in system variable(i.e PATH)
But first of all you need to download Node.js
I tried v6.0.1 but it is not compatible for ionic 2 for now, so you can download v4.4.x or v5.x from Node js site(sorry dont have 10 repo poits to post the third link) for now and later use v6.0.x
now using nodejs command prompt you need to install npm http://blog.npmjs.org/post/85484771375/how-to-install-npm
after installing npm
install ionic 2 and cordova using
npm install -g ionic#beta cordova
now Ionic is installed on your system.
To start a new project
ionic start Myproject --v2
and if you want to start a ionic project using typescript
ionic start Myproject --v2 --ts
Now give command
cd Myproject
to go to the directory of your project
after that, to test your app use
ionic serve

Ionic build not reflecting changes when running or deploying to app

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.

Cordova inAppBrowser plugin issue on windows

so I've been trying to add this plugin with command
cordova plugin add
https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
which worked on MAC and Linux after
npm update -g cordova
but on windows I'm still getting
cannot read property 'install' of undefined
Moreover - when I'm trying to uninstall ( cordova plugin rm org.apache.cordova.inappbrowser ) then I'm getting
cannot read property 'uninstall' of undefined
Weird thing is that I have two cordova folders - one in
C:\Users\me\AppData\Roaming\npm\node_modules and the second one in
C:\Users\me\AppData\Roaming\npm\node_modules\phonegap\node_modules . Path which I added to my environmental variables is C:\Users\mati\AppData\Roaming\npm\node_modules\phonegap\node_modules\.bin
I think that this is the problem reported about a week ago as CB-6008 on the Cordova bug tracker.
It may be a symptom of having an out-of-date cordova installation still. The issue there was solved by removing and reinstalling Cordova to ensure that the latest version was in use.
Delete the content of your platforms and plugins folder. re-install your plugins and the problem should be gone. In my case the following command
phonegap local plugin add org.apache.cordova.inappbrowser
produced -> [error] Cannot read property 'install' of undefined
and the above procedure fixed it.
Have you added a platform to your cordova project (before trying to add a plugin)?
npm update -g cordova
cordova create myproject
cd myproject
cordova platform add android
cordova plugin add _
I think the undefined error means a dependency of the add plugin command is not there.
For me, the solution was to update plugman module:
npm install -g plugman

Resources