Android - ionic - no platforms added to this project - android

I have successfully executed the following commands
$ npm install -g cordova
$ npm install -g ionic
$ ionic start myApp blank
$ cd myApp
$ ionic platform add android
But the next command is not working
$ ionic build android
when I execute the command, I see an error ie "No platforms added to this project. Please use 'cordova platform add platform'"
please help me with your suggestions, thank you

please do following:
npm install -g cordova
npm install -g ionic
ionic start myApp blank
cd myApp
cordova platform add android
you can use cordova while installing platform in ionic project because Ionic internally use cordova itself.
Please feedback me if error still persist.
Thank you

cordova platform rm ios
cordova platform rm android
cordova platform add ios
cordova platform add android
// edit
to execute these commands, you have to be in your root folder (where you have your config.xml)

use this command before you build cordova platform add android.
enjoy your code time.

Related

Ionic - Execution failed for task ':compileDebugJavaWithJavac'

I just added the platforms and plugin files to the .gitignore and ran these commands
git rm -r --cached .
git add .
git commit -m "message"
After successful pull and push, I was not able to run in the android device using the command
ionic cordova run android --device
Yes, I got the answer. I just Removed the android platform using the command
ionic cordova platform rm android
and then I added the android platform again using
ionic cordova platform add android

Ionic 3 Android build error

I am using Ionic 3. Right now I'm trying to do ionic cordova build android , but I get TypeError: env.runcmd is not a function (please see the photo attached).
I tried to:
-> ionic cordova platform rm android then ionic cordova platform add android then again build android again
-> delete node_modules folder and do npm install then build android again
But none of them helped it...
My ionic info output:
Just use command 'cordova run android' instead of 'ionic cordova run android'.
Okay, guys, the problem was exactly with cordova version. I haven't noticed when it did update to the version 7.0.1. However, I had to downgrade it to version 6.5.0 and then android build succeeded.
The only thing that confused me was the downgrade process. Every time I did sudo npm uninstall cordova -g, the cordova command was still available at bash. If I would do sudo npm install cordova#6.5.0 -g, the version still remained 7.0.1. Even some other commands such as ... --save --save-exact ... did NOT work.
So below are the steps which I've gone through to solve this issue (I am using Ubuntu linux, so this will work for linux users only).
First I uninstalled cordova through npm
sudo npm uninstall cordova -g
Then removed the program from local bin
sudo rm /usr/local/bin/cordova
Installed the specific version of cordova
sudo npm install cordova#6.5.0 -g (or whatever version you want)
And lastly, I have to admit that after cordova installation, it was now located at /usr/bin/cordova, no more at /usr/local/bin/cordova, so I had to create a hard link to it.
sudo ln -s /usr/local/bin/cordova /usr/bin/cordova
VoilĂ !

"No command 'ionic' found" and "workon: command not found"

I have a weird problem in my Ubuntu 14.04.
I was developing a mobile application using Ionic with an API using Django-Rest-Framework. After developing, I downloaded jdk and Android SDK so that I can build the mobile app into APK. I also downloaded the android dependencies or tools needed for building. After I downloaded it all, I go to my mobile app folder and type ionic platform add android to build it. But the terminal response with "No command 'ionic' found". Even typing ionic serve responses the same. I also tried to activate the virtual environment of the API using workon mobile but it responses with workon: command not found. Does anybody have an idea what might be wrong? Thanks
First Check ionic is install or not by using following command
ionic -v
It shows version if it nothing to show then install ionic by using following command
sudo npm install -g ionic
else update ionic by the following command on your terminal
sudo npm update -g
And also if you have not got the result then create symbolic link by using following command
sudo ln -s /usr/bin/nodejs /usr/bin/node
Hope this will help you !!
First install using this two line..
npm install -g cordova ionic
ioniv -v && cordova -v
and then use this line
$ ionic start myapp [template]
$ cd MyIonic2Project/
$ ionic serve

Running PhoneRTC Demo

I am trying to run the phoneRTC demo, I hae build the android demo app and have a signalling server running but when I run the client app on android all I get is a blank screen.
these are the steps I have taken:
npm install -g cordova bower grunt-cli
git clone https://github.com/alongubkin/phonertc.git
ionic create phonertc-ionic
cp -R phonertc\demo\client\* phonertc-ionic\
cd phonertc-ionic
npm install
bower install
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
cordova plugin add https://github.com/alongubkin/phonertc.git
cordova platform add android
cd ../phonertc/demo/server
npm install
node index.js
change server details in phonertc-ionic/app/scripts/signaling.js to:
var socket = io.connect('http://my_server_ip:3000/');
and run the following in phonertc-ionic:
grunt build --force
cp -R app/* www/
cordova build android
My signalling server is running but when I try to hit the port via a browser I get the following message:
Error: ENOENT, stat '/home/server/index.html'
and when I run the app on my phone I just get a blank screen.
Am I doing something wrong?
I solved the problem, turns out there was a bug in the grunt version I was using, using an older version or manually adding the libraries instead of using grunt worked.

Cordova Plugins Installation MAC

I am using Cordova 3.3.0 and I want to install the camera and network plugins. In netbeans it is very simple to do so but I can't understand how this can be accomplished on MAC. Please note that I am very new to this.
I am trying to run the following command in the terminal:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
An error is saying
-bash: cordova: command not found
Can anyone guide me what needs to be done?
Thanks
If Cordova is well installed on your Mac, you need to add "/usr/local/share/npm/bin" directory to your $PATH variable. Open your Terminal / Command line and type:
export PATH=$PATH:/usr/local/share/npm/bin
Else, before install Cordova typing :
npm install -g cordova

Categories

Resources