My cordova version is out of date and I am receiving an error on google play that I won't be able to upload an app unless it's been updated. Well, I updated my cordova version in my OSX terminal and I'm currently running 5.2.0. When I check my project's cordova directory, it says it's at VERSION = 3.4.0.
How do I actually update the cordova version in my app that has already been built? I thought the correct command was cordova platform update android when I go to the specific directory. However, I'm receiving a "current working directory is not a cordova-based project" error.
Below is my directory; I have tried using just my main directory and also /cordova and /CordovaLib with no success. Can anyone help?
Related
Long story short, I've tried all sorts of solutions SO and other sites have proposed, and I'm certain none of them handle my scenario. I'm using Cordova to build my apps. I recently reinstalled Cordova, and apps stopped building.
Yes, I've installed and included gradle in my path (I'm on Windows)
I've verified and gradle is installed (gradle -v) from command prompt
When I open the project directly from Android Studio, it finds gradle and builds successfully
When I use cordova to run it from the cmd, I get the above error
Funny enough, when I delete downloaded files from C:\user\.gradle as some SO and GitHub solutions suggest, it downloads gradle, and after completing the download, still tells me gradle couldn't be foound
I've upgraded Node, NPM and Cordova to their latest versions. If it's of any help, I'm building on Ionic and both Ionic and Angular have been equally upgraded to their latest versions. Ionic serve and every other related command works. Here's the command that triggers the error:
ionic cordova run android
You should ensure the path of the gradle installation is exactly the same path you are setting in your environment/path variable.
That solved it for me
how to update files in existing cordova project android platform?
i converted my web app to cordova app to go native -
i uploaded the cordova app to the play store, and now i want to upload a newer version of the app - the problem is that i don't know how to update the files in the existing cordova project without deleting it and start all over again -
i have multiple plugins in the older cordova project and do not wish to start from the beginning and install them.
my OS is windows 10 , and i work with Android Studio
You can make your changes in the www/ folder of the project (where your web code is housed), and then run cordova prepare ... this will essentially copy your www files to the platform (Android in this case) specific location.
You can then rebuild in Android Studio or by running cordova build android
This way your plugins are untouched and only the web code is updated.
I'm trying to make an apk of the web app I made in babylonjs.
From my understanding you can use Cordova to convert a web app into an apk.
I was able to install Cordova and make its hello world apk download to my phone and open and run it just fine.
However my problem occurs when I put all of my web app files into the www folder in my Cordova project folder. After I do that Cordova gives me this error
Error: ENOENT: no such file or directory, stat '/Users/dylan/practiceApk/www/node_modules/.bin/nopt'
when I try to build the android version.
Here is some information about my setup I believe is relevant.
OS: Mac
cordova -v: 7.1.0
Cordova requirements:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-24
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
cordova info also gives this error(similar error I believe to the one above):
Error retrieving Android platform information:
Android SDK is not set up properly. Make sure that the Android SDK 'tools' and 'platform-tools' directories are in the PATH variable.
Error: android: Command failed with exit code ENOENT
But I tried a lot of different things to fix this. Most of them involved making the android tools in the path (er something..?) I also downgraded from the most recent version of Cordova and android. I believe the problem is in my web app node_modules/.bin/nopt
But I don't know why its is a problem.
Also im not sure how this affects it, but I'm not hosting the website anywhere I just assumed I can used Cordova to create the web app as an apk that could be used offline, all resource are in the project folder though.
Any ideas on how to fix this? I only started using Cordova today so I don't know much about it.
Thanks for your time!
Update: I tried building an iOS version and I get the same error. I believe this is an issue with my npm setup...
It seems that when I was copying over my project to the newly made Cordova project folder I also copied the node_modules folder and didn't actually initialize npm. After initializing it and then updating it would build the app.
I developed a cordova app on 2.6.0. Now I have to upgrade it to 3.5.1 or higher since Google Play Store sent me a mail to do so.
Now I installed the newest version of Cordova by npm install -g cordova and created a new project in the right (old) namespace. I added all plugins, copied the old www-files to the new www folder and added the android platform.
Back in Eclipse (Juno) I imported the project and tried to build it. Eclipse tells me to solve all errors firstly. After all I realized that all files under src were marked with errors.
I searched the web but I could not get any information on what is going wrong...
What would be the right way to find out what is going wrong and how to solve this errors probably?
Thanks in advance for your help!
I am trying to create a phonegap / cordova app using the 3.1.0 version.
Created my app with the command:
cordova create hello com.example.hello HelloWorld
And after running this command:
cordova platform add android
to add android platform, i am getting:
[RangeError: Maximum call stack size exceeded]
Any idea what could be the issue?, previously i created another app, but same error was occurring when adding camera plugin.
I faced the same issue, but I was actually issuing the command in wrong directory, so firstly I changed the directory to Hello then issued the command.
So, I have directory structure as,
---Cordova
---Hello
and I was actually issuing the command by being at Cordova folder. After that I changed the folder to Hello then executed this cordova platform add android and it worked.
Please check once
be sure you are located in the created directory (Hello, I guess), the same level with .cordova
cd Hello
For anyone coming to this question after July 2013 (when Cordova 3.0.0 was released), there is another reason for this problem.
If you created a Cordova project on a computer with Cordova 3.x and you are trying to work with it on a computer that still has the old 2.x version, you will get this error because of how the project structure changed between the versions.
Upgrading Cordova to the newest version using npm install -g cordova will fix the problem.