I have issues in adding platform android using cordova command due to which i cannot be able to build my ionic app
Try to run the project in other Drive instead of C: Drive
Related
How to run moodle mobile app on android studio? I want to add my own plugins as well.
I have followed moodle documentation https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2 but it stuck on Native build dependencies.
Code I am following: https://github.com/moodlehq/moodleapp
Also try to run this code on android studio ( follow:https://www.youtube.com/watch?v=IA3c2lpoOtU&t=757s ),I am having a blank white screen(I have paste moodle src folder on www folder and run the src/index.html)
Can somebody share video tutorial regarding this? It will be really helpful.
At first you need to add android platform to your project by these bash commands:
Removing and adding
npx ionic cordova platform remove android
npx ionic cordova platform remove ios
npx ionic cordova platform add android
npx ionic cordova platform add ios
Once you have added platforms, you can run setup using this command:
npm run setup
After successful setup you can open the the project in android studio:
android studio project location should be CORDOVA_PROJECT_DIRECTORY/platforms/android
Source:
https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2
I m new to cordova/ionic.
I have a cordova project which i want to run either on android device or emulator.
When i run the command : ionic cordova run android.
I get the following error :
Detected locally installed Ionic CLI, but it's too old--using global
CLI.
cordova platform add android --save Using cordova-fetch for cordova-android#7.0.0 Error: Failed to fetch platform
cordova-android#7.0.0 Probably this is either a connection problem, or
platform spec is incorrect. Check your connection and platform
name/version/URL. Error: cmd: Command failed with exit code 1 Error
output:
in the code platform android already exists, but when i check its version it i s, android~6.3.0.
I have tried a number of things to resolve it which includes, reinstalling cordova, android.
Can anyone have a solution for it.
The code was written around a year back and now i have all the latest versions installed in my system
Problem is android platform was not added properly. Therefore you have to add respective Android Platform into your Project.
Before adding run :
cordova platform remove android
After run :
cordova platform add android#6.0.0
if you develop on windows enviroment You can check the version of Android provided by Cordova under :
C:/Users/%USER%/.cordova/lib/npm-cache/cordova-android
You may also want to try adding --nofetch to the command, which will use the pre-7.x behavior. See Cordova 7 fails to add android platform
You can try it by firstly updating your android sdk manager with all the latest updates and also update its gradle. Then try to firstly remove the android platform using command
CORDOVA PLATFORM REM ANDROID
and then add android platform using command
CORDOVA PLATFORM ADD ANDROID.
I am starting to learn Ionic, and on building my first application, when typing the
# ionic platform add android
it says that the command has been renamed. My question is, what was it changed with?
In the tutorial I follow, it says to execute the commands
# ionic platform add android
# ionic build android
# ionic run android
On searching the web, I have come across the command
# ionic cordova run android
and it also said that cordova was moved to a CLI which also has to be installed.
But what about "add" and "build"? They are not required anymore?
Thank you.
I believe you are using latest Ionic version, 3.6.0 and above. Since then Ionic cli commands have renamed from
ionic platform add android to ionic cordova platform add android
For all the commands append cordova after ionic keyword.
For list of command, refer to the documentation here at https://ionicframework.com/docs/cli/
Your tutorial commands are outdated. But you can still follow them, but just append cordova after ionic keyword
ionic platform add android becomes ionic cordova platform add android
ionic build android becomes ionic cordova build android
ionic run android becomes ionic cordova run android
"But what about "add" and "build"? They are not required anymore?" - You still need them for adding platforms/plugins.
add is used for adding platforms/plugins. For ex: To add ios platform you use ionic cordova platform add ios
build is used for Build (prepare + compile) an Ionic project for a given platform. For ex: To build ios you need ionic cordova build ios
Note: you can replace ios with android or vise versa in any of the above commands.
Since you started learning check this website out, might be a good place to start - https://ionicacademy.com/
Now "ionic" is renamed with "ionic cordova".
So use:
ionic cordova platform add android
ionic cordova run android
***for run on windows****
ionic cordova platform add browser
ionic serve
I have build platform for android and ios at starting of the app.
I want to override android and ios build after some completion of the project.
command I'm using:
ionic platform build android
and it's giving error:
error: Platform "build" not recognized as as core cordova platform. See 'cordova platform list'.
I have tried even:
cordova platform build android
it's showing Available platforms. But apk file is not getting overridden.
What should I do to get a latest apk build output.
The build command is:
ionic build android
I am also facing this error but after uninstall all the ngCordova plugin and reinstall all, then i got No Error.
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.