Downgrade Phonegap android version from 3.40 to 2.9.0 - android

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

Related

Ionic Cordova Android build fetches cordova-android 9 instead of 10

I have updated my Ionic Cordova project on my development machine to use cordova-android 10, via:
ionic cordova platform rm android
ionic cordova platform add android#latest
After this I have the following in my package.json:
"cordova-android": "^10.1.1",
I've updated build tools and sdk etc in Android Studio, do my build and all works fine.
Now, I check in my source, and do the same Android Studio updates on my Mac.
However, now when I do the same build (on the Mac), I see the message:
> cordova platform add android --save
Using cordova-fetch for cordova-android#^9.0.0
And also it has updated my package.json back to "cordova-android": "9.1.0".
My question is, why could it do this, instead of fetching the 10.1.1 as is dictated in my package.json?
I found a solution.
First, check the version of your android platform by using this command
cordova platform
You should see the version 9.x.x
Then run the following command
cordova platform add android#10.1.1
Re execute
cordova platform
You will see the version 10.1.1
That's it

"Error: Your android platform does not have Api.js" when trying to build android version 5.x.x

cordova version is 7.0.1
node version is v8.0.0
when running cordova platform add android#5 everything works fine. (except for cordova-plugin-media requiring android version >=6.1.0 but thats another story)
When running cordova platform add android#4 (similar for cordova platform add android#3) I get
Using cordova-fetch for cordova-android#4
Adding android project...
Error: Your android platform does not have Api.js
despite cordova officially still supporting those android versions. What am I missing here?
The only other post remotely containing this particular error I found is here, but it was not helpful.
I solved this problem trying 6.0.0 version
npm install -g cordova#6.0.0
then there was error with bplist-parser in npm
npm install -g bplist-parser
All works fine!

Cordova Error using Cordova-Android 6.2.0 - getFileResources is not a function

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.

Is it possible to download corodava jar version greater 3.5

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.

how to get phonegap latest version

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" />

Categories

Resources