Am just getting started with ionic 2 and am having problems with the installation . I want to know the requirements for installing ionic 2 apart from node and npm.
Do i need to have android sdk installed? What other stuff should I have.
You would need java sdk 1.7 or higher.
You do need to download the Android Studio and install the required android sdk version for which you would want to build.
You would also need the node version of minimum of v6.9.0 or higher.
try running node --version
And do read up on ionic appscripts in github. There are changes perhaps you would need to apply - https://github.com/driftyco/ionic-app-scripts
You could also Try installing nvm -
https://github.com/creationix/nvm
its called the node version manager. will allow you to have multiple versions of node installed and certainly recommended.
Preferably try and build on the linux platform, to avoid silly issues in windows.
Things you need for installing ionic with windows
nodejs
android sdk
java sdk.
setting path is most important
apache ant
You could check out this link for installing and running to android device
http://www.tiagoporto.com/blog/environment-setting-tutorial-ionic-android-on-windows/
to setup ionic you need to do the following
run
sudo apt-get install nodejs
sudo npm install -g cordova
then
sudo npm install -g ionic
Done run ionic serve inside app folder created using
ionic start todo super --type v2 !!
this will help you to run app on browser
now to install on device,
you need android SDK,
and then you will be able to install apk on phone.
to do that you need to setup android SDK
use the following lines to do that
Install openjdk
sudo apt-get install openjdk-7-jdk lib32stdc++6 lib32z1
Download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
install all sdk packages
cd android-sdk-linux/tools
./android update sdk --no-ui
Set android-sdk path
pico ~/.bashrc
Add these lines on top, save, and exit
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Reload bashrc
source ~/.bashrc
Related
I installed the flutter and using android studio to run the flutter project on simulator. I clone the project from git and run it shows this error
Error: To set up CocoaPods for ARM macOS, run:
arch -x86_64 sudo gem install ffi
Error running pod install
Error launching application on iPhone 14 Pro Max.
but when I make the new basic project it runs fine but not the cloned project. I tried some stuff.
open ~/.profile and add these
exports export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Also uninstall cocoapods and reinstall again. but nothing works for me.
what i am missing here?
Spending few hours on this problem finally it works for me.
Step 1: Uninstall the cocoapods by running this command in your project folder terminal
sudo gem uninstall cocoapods
Step 2: Install the cocoapods by running this command
brew install cocoapods
Note: Not forget to restart the android studio otherwise it would show another error. just close your project, close android studio, rerun the project or simulator.
Hope it will help someone.
I'm trying to install the Ionic framework with npm. It successfully installed. But when I try installing new versions of Ionic and Cordova, I was unable to install and Error messages are coming frequently in the ubuntu terminal.
I had a same problem but i recovered it using following command:
npm install -g cordova ionic --verbos
if its not work then you need to try yarn. you can download and install form https://yarnpkg.com/lang/en/docs/install/ this website
After install, run the following command
yarn add global cordova
yarn add global ionic
I'm trying to start an Ionic v2 project following the official docs here, but I end up with an Ionic v1 project every time. My steps:
Remove current ionic and install the beta:
$ npm uninstall ionic -g
$ npm install ionic#beta -g
/Users/mike/.npm-global/bin/ionic -> /Users/mike/.npm-global/lib/node_modules/ionic/bin/ionic
/Users/mike/.npm-global/lib
└── ionic#2.0.0-beta.32
Create a new Ionic v2 TypeScript project:
$ ionic start ionic2-test --v2 --ts
Creating Ionic app in folder /Users/mike/dev/ionic2-test based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================] 100% 0.0s
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project
Adding in iOS application by default
But a v1 project is created:
$ cat ./ionic2-test/www/lib/ionic/version.json
{
"version": "1.3.1",
"codename": "el salvador",
"date": "2016-05-12",
"time": "18:21:10"
}
$ head -2 ./ionic2-test/www/lib/ionic/js/angular/angular.js
/**
* #license AngularJS v1.5.3
My ionic info:
Cordova CLI: 5.4.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.7.8
Ionic App Lib Version: 0.6.4
ios-deploy version: Not installed
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.3 Build version 7D175
What am I doing wrong?
So, the problem is that the Ionic CLI is not being updated to the latest one (2.0.0 beta-32). Have you tried by doing this:
After $ npm uninstall ionic -g, update npm and clean npm's cache:
npm cache clean -f
npm install npm -g
Delete manually any folder containing references to Ionic like those you've included in the question:
/Users/mike/.npm-global/bin/ionic
/Users/mike/.npm-global/lib/node_modules/ionic/bin/ionic
/Users/mike/.npm-global/lib
And then after that:
$ npm install -g ionic#beta
or (on Mac and Linux you’ll need to add sudo to install Ionic globally):
$ sudo npm install -g ionic#beta
#sebaferreras lead me to the solution.
Even after sudo npm uninstall ionic -g, the ionic command was still available:
$ which ionic
/usr/local/bin/ionic
So I think I must have had it installed in multiple places. There seemed to be something generally screwed up with my node installation (I possibly installed from homebrew as well as from the official .pkg download), so I decided to completely remove it all and start from scratch, as described here:
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
I then reinstalled node using the official .pkg from their website, su-did npm install -g ionic#beta, and now...
$ ionic info
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
...
So I'm all fixed up!
this link will solve and save your time: http://ionicframework.com/docs/v2/getting-started/installation/
the simple way to create a ionic project: go to your into the directory where you want to create you project and the type this cmd:
ionic start cutePuppyPics --v2
Your Ionic CLI is not updated yet. Just run the command "npm install ionic cordova" once again, no need to uninstall the previous version manually. It will override the previous version automatically.
Just for your future help: To build you first app in Ionic, You might need to update jdk to 1.8, sdk to latest one from sdk manager (no need to change target sdk) and the first build will download a number of Gradle files, so, good Internet connection is needed.
Installed Ionic successfully. When running ionic info and other commands like ionic browser --list, I get an error that cordova is lower then version 4.
Cordova is installed with no sudo and in global home directory.
> ionic info
Your system information:
Cordova CLI: 6.1.0 (cordova-lib#undefined)
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10
Node Version: v5.9.1
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly suggested to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Cordova installation is at:
> which cordova
/home/user_1/.npm-global/bin/cordova
Ionic installation is at:
> which ionic
/home/user_1/.npm-global/bin/ionic
I am using cordova#6.2 and ionic#1.7 as well. After I got this error message, I opened a new terminal and typed cordova -v which outputted:
? May Cordova anonymously report usage statistics to improve the tool over time?
As soon as I entered my answer (No), the version number printed out and then I re-ran ionic info in my project terminal. The error was gone.
Caveats
I had just updated ionic#1.7.16 from 1.7.15. It's a very minor patch with one set of bug fixes that are not related to this.
The particular system that I had this problem with is running Windows 10.
The first time I ran ionic info in my project directory, I got the same error twice.
Original Error Output:
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Your system information:
You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS:
Node Version: v4.4.2
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
I've tried a lot of different methods to resolve this, like reinstall with and without the --unsafe-perm=true --allow-root flags (which is how others advised to fix it on other questions/other places online) but it seems to be an issue with cordova at version 6.1.0 and ionic so for now use 6.0.0 by running
npm install -g cordova#6.0.0
That should do the trick as it is seems 6.1.0 isn't a stable version.
cordova telemetry off
Made the error disappear when running
ionic info
I chose to opt out of Telemetry which collects data during development for analytics. You can also opt in by using the "on" keyword instead.
Hat tip to Wayne Bloss for guiding me to this answer.
I had exactly the same result as Wayne Bloss on Windows 10. The error "> = 4.2.0" on the first attempt, and after checking the version "cordova -v", the error was gone (I answered Yes to the question on statistics).
As stated by Wayne Bloss this warning disappears when answering the question triggered by the command cordova -v. This worked also for my configuration using Cordova 6.3.1.
This works because the original reason for this is that the version information string for Cordova CLI not only contains the version number but also this piece of information "You have been opted out of telemetry. To change this, run: cordova telemetry on." which makes the internal evaluation of the string with semver return always false. Answering the telemetry question with "no" removed the string from the version thus making the warning message disappear.
I just ran into this so I found this page and seems like no proper answer so here is one.
Installing the cordova-cli deb package requires to:
Add the Ubuntu Cordova Personal Package Archive to your Ubuntu system
Install the cordova-cli package (and its dependencies)
So, for ubuntu
sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
More info here
https://cordova.apache.org/docs/en/latest/guide/platforms/ubuntu/index.html
As others have noted, a possible cause of this is noise from cordova telemetry.
The issue is still present in cordova 6.5.0 and ionic 2.2.2.
As an additional piece of information, I would like to add that the following has to be run for the current user, e.g. if you have a CI system that installs cordova as root and then runs ionic as a non-privileged user, you will have to run
cordova telemetry off
again.
D:\>ionic start myapp blank
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Creating an Ionic app in D:\myapp based on the blank template.
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic-starter- blank/archive/master.zip
Installing npm packages (may take a minute or two)...
/
? ♫ ? ♫ Your Ionic app is ready to go! ? ♫ ? ♫
The Ionic application is started without any issue of Cordova updating.
You can however, use the following code to update:
npm update -g cordova
It's well written in the caveat, You need to install cordova in your npm using npm install -g cordova
or
npm install -g cordova#4.2.0
Problem solved!
I'm totally new to app development and just started to make my first steps.
I've installed Cordova and the needed utilities according this guide.
I've created my first app (using Cordova's create script) and I'm able to run it on my Nexus 4.
Now I tried to install a plugin using plugman, and I'm stuck.
This tutorial says I can install a plugin using
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
in the application directory.
Two issues here:
1. In the application directory itself isn't a executable file named "cordova"
2. When I swtich to the cordova directory and execute the mentioned command, I get this error:
Cordova does not recognize the command plugin
Any ideas what I'm doing wrong? Or is ther a mistake in the tutorial?
Thanks a lot for any help!
EDIT:
I managed to install the plugins using plugman directly using
plugman install --platform android --project . --plugin
https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
But nevertheless I'm still interested in how to install the plugins using cordova...
Below are several ways I've used to install plugins from Cordova CLI, hope it helps:
Firstly, make sure you've installed cordova correctly(please refer to official document if needed):
cordova -v // should print something like "3.5.0-0.2.6"
Install from Cordova plugin registry
cordova plugin add org.apache.cordova.device
This should cover most cases and here is a list of plugins available in Cordova Plugin Registry.
Install from a remote repository, typically from GitHub
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin
If you encountered something like "Error: Command failed: error: Failed connect to help.github.com:443; Connection refused while accessing", typically it's a proxy issue, you could retry after config your proxy:
git config --global http.proxy http://user:password#proxy:xxx
If it still not works, you could click "Dowload Zip" from github, unzip the downloaded file and then:
Install from a local directory
cordova plugin add /path/to/directory
It will look in this directory and each of its subdirectories for the plugin.
NOTE: this is related to Android platform of cordova 3.4 on my windows 8 machine (tested)
step 1=> Install plugman by command in cmd "npm install -g plugman" (note that you must have node installed)
step 2=> Download git from http://msysgit.github.com/ for windows (15 mb) install exe file
step 3=> create new variable in enviorment variable name = GIT_PATH and value= "C:\Program Files (x86)\Git (this is mine urs may be diff)", now append %GIT_PATH% in Path variable (very Important) check git command in cmd if no error than continue otherwise fix this now
step 4=> Now go to http://plugins.cordova.io/#/ find whatever plugin want to install. and get just this repository url like
step 5=> now whatever and anywhere project is, place following command in cmd
**plugman install --platform android --project F:\my17app\ --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git**
Step 7=> If it successfully install we can see in app/res/xml/config.xml file a new feature will be added with id of new plugin
PS: For environment variables see in control Panel=> System and Security => System =>Advanced System Security
I did it in this manner
D:\phonegap\hello>plugman install --platform android --project D:\phonegap\hello
\platforms\android --plugin org.apache.cordova.battery-status
where as for doing it from git
plugman install --platform android --project D:\phonegap\hello
\platforms\android --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git