We started building a barcode app using Phonegap in Android, we are facing a problem with barcode.js.
We are using phonegap 2.9.0 and barcode plugin 3.0 .We are getting a problem that cordova.plugins.barcodeScanner is not recognised. I read some where that I have to upgrade phonegap 3.0. But I am not able to find the version phonegap 3.0. Can anyone provide the links and docs?
Use phonegap -v
to check current installed version of phonegap, if your current installed version is not 2.9.0 then update your phonegap installation using
sudo npm update -g phonegap
Use npm info phonegap version to check the latest version of phonegap available, if it doesn't suits your requirement then use
sudo npm install -g cordova#3.1.0-0.2.0
to installed a specific version of phonegap.
Phonegap/Cordova has changed much from version 2.9 to 3.x and 4.X.
You don't install it from a zip any more from a zip, now you have to install node.js and npm and then use npm to install cordova (steps are explained in the cordova website).
I suggest you have a look at my answer in this other post for considerations about migrating a project from phonegap 2.9 to 3.x.
find config.xml in you project and change this specific line, change the value to any version you want to use in your project
<preference name="phonegap-version" value="3.4.0" />
Related
I have an ionic/cordova project using:
cordova-android#6.2.0
cordova-plugin-crosswalk-webview#2.3.0
cordova cli 6.4.0
ionic 1.3.3
When I try to add the Android platform, I get the following output
================
$ ionic platform add android#6.2.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.ionicframework.name
Name: name
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.0
Error: cordovaProject.projectConfig.getFileResources is not a function
It seems this issue is related to a bug in cordova-android#6.2.0, as confirmed here: https://issues.apache.org/jira/browse/CB-12633
I have now updated my system to cordova-cli - cordova#6.5.0 and cordova-android#6.2.1, and it seemed to work.
Update to version 6 of cordova cli with:
npm install -g cordova#6
And then add the correct version of cordova-android
cordova platform add android#6
Not directly related to this issue, but once I got it working, my system did complain about the gradle path not being set when I tried building my app, and so I followed the steps here: https://gradle.org/install#with-homebrew, and now all builds successfully.
update cordova
npm install -g cordova
and then try to add platform or if any problem with new version of cordova then use below
There is a problem with cordova version 6.4.0 and android 6.2.1. So, please try with below compatible versions
cordova version must be 6.4.0
npm install -g cordova#6.4.0
Install android in your project
cordova platform add android#6.1.2
or
ionic platform add android#6.1.2
Do whatever #IonicBurger has said above.
Also make sure that for Cordova based projects, each cordova version has specific dependency on android SDK and android build tools installed.
I am currently using Ionic 3 and I faced the same issue.
Make sure cordova is latest: npm i cordova -g will do the job. Note what version of cordova is installed by checking cordova -v. After that ensure you have installed ionic-native; this usually comes with ionic installation, but it wont harm to installed this again locally with npm i ionic-native --save
See all available platforms: ionic cordova platform list. Some plugins like camera, media etc have very specific cordova requirements (refer here)
When you install a plugin, you may encounter such error sometimes: 'Plugin doesn't support this project's cordova-android version. cordova-android: 6.1.2, failed version requirement: >=6.3.0
Skipping 'cordova-plugin-camera' for android'. Thats okay. This can be resolved by above two steps. Most importantly remember this: Ensure you have latest Android Build Tools and SDK installed.
Please see the following image for more detail:
Note that this answer works best with Windows environment.
Updating to cordova#6.5.0 didn't work - I got error that this version is not found
Instead reverting to cordova#6.1.2 did work
cordova platform update android#6.1.2 --save
It is not the right solution downgrade the cordova version. If you want to use the lastest version of cordova and ionic, instead of using
ionic cordova platform add android
Just do:
cordova platform add android
works like a charm!
Good coding!
This problem occured for me when switching between two ionic projects.
I fixed it by trying another node version and it works.
I used nvm use x.x.x and by downgrading to a previous nodejs version, I was able to build my project.
Hope it'll help someone.
I have a quite old version of cordova. For Android it's 3.6.4 and for iOS 2.9.1.
The latest version for Android is 5.1.1 and for iOS 4.1.1 and I would like to upgrade it.
However the application is a non-cli application and it's mainly standalone application.
I've noticed in https://cordova.apache.org/docs/en/latest/guide/platforms/android/upgrade.html that it mentions
Alternatively, you may attempt to use the platform update script. For
non-CLI projects, run:
bin/update path/to/project
I'm using a mac OS for upgrading the cordova and I'm not so sure where I could find this script bin/update.
Any hints for how I could make the upgrade would be useful.
Thanks
I have finally used the npm package manager as described in
https://www.npmjs.com/package/cordova
and install nodejs through brew for having cordova and npm.
I have corodava.js version of 2.9 in my app but google send a alert to update the corodava version due to security issues. I had searched latest version but all the latest version are available with node.js CLI . I hardly want a corodava jar alone .Is the phonegap corodava version is available ? Thanks in advance .
You can download the cordova android source code from here:
https://www.apache.org/dist/cordova/platforms/cordova-android-3.6.4.tgz
Then uncompress it, go to cordova-android-3.6.4\package\framework in a terminal or cmd
write this command:
android update project -p .
when it finish write this one
ant
That should build a cordova-3.6.4.jar
But if you are using plugins right now, cordova 3.X.X doesn't include them, you will have to include them using plugman.
Just execute this in your project folder:
cordova platform update android
This will upgrade to the last cordova version, that fixes these security issues.
I recommend to remove & add android platform to have a clean android project:
cordova platform rm android
cordova platform update android
cordova platform add android
Note: This is only for Cordova 3.x users..., From Cordova 2.x it is needed to install Cordova.
I cloned an existing ionic project from git. I have ionic 1.3.2 and cordova 4.2.0. After cloning, i cded into the directory and did an ionic browser add crosswalk. It says that crosswalk was added successfully. Then when i try to do ionic run android, it says
No platforms added.
So i do a ioinic platform add android, which gives me this error:
Failed to install 'org.apache.cordova.engine.crosswalk':CordovaError: Plugin doesn't support this project's cordova-android version. cordova-android: 3.6.4, failed version requirement: >=4.0.0-dev`.
ionic platform add android#4.0.0-dev returns
Unable to fetch platform android#4.0.0-dev: Error: version not found: cordova-android#4.0.0-dev
How do I fix this?
P.S. I am using ubuntu 14.04
The problem is crosswalk browser.
If you revert back to android webview, which sucks, but works.
ionic browser revert android
ionic platform rm android
ionic platform add android
As of today, 4/9/2015. I have been able to go back to the old projects and add crosswalk after updating node runtime, ionic, cordova
Before running ionic run android have you tried adding a directory named www?
It seems that by entering ionic platform add android, it installs the platform from the npm and the latest cordova-android version, which is.... 3.7.1 (currently)
Cordova-android 4.0 is still beta, but there's good news for those who wish to install it. You can download the 4.0 version directly from the apache github repository:
ionic platform add https://github.com/apache/cordova-android.git
There are more bugs along that road, but at least it's a working solution for that bug. It seems that apache still have plenty of issues with plugins compatibility, hopefully they'll overcome them in the next official release.
Update:
Download Intel XDK. This is just an unbelievable tool for developing mobile apps, Intel has really figured it out imo. Built in brackets, emulator, remote debugging, and most important: One button click to build apks with crosswalk for android. All you have to do is importing your www folder and you are good to go!
My app went from sluggish 5fps while scrolling to fully native feel in a click. I'm still in awe. :)
I am using phonegap 3.4.0 version for my android app project. My app is working fine in this version. Now, I want to test my app in cordova version 2.9.0. I have searched net and haven't get a grip on this issue.
My question is, how do i downgrade my phonegap version 3.4.0 to phonegap version 2.9.0?
also, cordova library is not showing up in my eclipse after changing version to 2.9.0. Without CordovaLib the project will not run. What should do to add CordovaLib in my app?
To downgrade my phonegap version 3.4.0 to phonegap version 2.9.0, I used the below command line interface:
$ sudo npm install -g cordova#2.9.0
This Link helps me to add CordovaLib in both ios and android.
REF: Phonegap 3.3 Eclipse: -CordovaLib project missing Android properties
npm install -g phonegap#2.9.0-rc1-0.12.2