ionic-Configuration and first program "Draft trial version"

Source: Internet
Author: User
installation Process

Ionic installation Notes

Tutorial is always a tutorial, the actual operation found a lot of problems, below I will record the personal related configuration process, for reference only. Install ionic

Assuming that the nodejs-has been installed well, return to the first step to see.

Input:

NPM install-g Ionic

For installation. Install Cordova

Ionic is dependent on the Cordova, do not forget to install this:

NPM install-g Cordova

PS: If prompted warning:

Please update to Minimatch 3.0.2

This, then you can run the following command:

NPM install-g minimatch@ "3.0.2"
New Ionic Project
Ionic start app Name [Template type-can be omitted, default tabs]

We're using defaultapp,tabs as a template here.

Ionic Start Defaultapp Tabs

Add Android Platform

If the app name we created is Defaultapp, then we need to go to the directory and execute the command.

CD Defaultapp
Ionic platform add Android

compile Ionic project for Android project

Ionic Build Android

PS: I'm afraid this mistake is for us to configure the operating environment of Android. Here we go to configure Android environment configuration

I'm sorry, I've already installed Android before,

However, if not installed, please visit the following article,
IntelliJ development of Android and Genymotion cooperation

Read and install with reference to the following:
Installation of the Java SDK
Download the Android SDK

Configure the Android environment variables below

Assign the location of the SDK to the Android home variable:

C:\Program Files (x86) \ANDROID\ANDROID-SDK

Add%android_home%\tools to path, and be careful not to change other file paths, just add them after the semicolon

Configuration complete, then continue compiling.

Yao Shou, then download the ANDROID23 version. Let's take a look at how to manually configure a version of Android system-the celestial network environment is not able to use the SDK automatic installation function, how many times failed to install.

Android SDK related resource integration posts

Then click on the installation to

After the installation we continue to execute the command and we can see:

Ionic Build Android

I'm afraid the compilation process is going to use Java,anroidsk, and I need to download some of the components, but in the end, the compiler succeeded, saying that the red mistake was Kazakhstan's meaning. Running Programs

Ionic emulate Android

Execute the above command, and then there are:

There is another problem, the effect is not found the corresponding system image

Check, under the Android SDK, there is a folder called System-images, with a variety of mirrors, to see:

No 23 mirroring, okay, now download a mirror

After installation, open to the tools directory of the Android SDK and execute:

Android.bat AVD

Create a virtual device.


Continue to execute

Ionic emulate Android

There's another problem.

Searching the web, one of the solutions is:

Starting emulator for AVD ' Android4.0.3 ' 

panic:could

does not cause the problem because the open:android4.0.3 is not configured, The emulator takes the current user's environment directory as the Android_sdk_home directory, causing an error.

we only need to set the system environment variable android_sdk_home for your own SDK installation directory, I set the directory for F:\Android\android-sdk_r06-windows\ Android-sdk-windows,


operation:
-My Computer, properties, advanced. Environment variables.
-New system environment variable,   
-name: Android_sdk_home
-Variable value: F:\android\android-sdk_r06-windows\android-sdk-windows
 Then close eclipse, restart Eclipse, delete the AVD created before, and then recreate it to start normally.

According to the data, set the environment variable, delete the previous AVD, then create a new one, then close the previous command line, open it, and then execute

Ionic emulate Android

See:

Regardless, create a new AVD, then click Start to get:

There is still a problem.

And then

And there's no way to run it.

No emulator specified

A small software installation is required to support the x86 operation. The solution is as follows:

EMULATOR:ERROR:X86 emulation currently requires hardware
acceleration! Please ensure the Intel HAXM is properly installed and usable.
CPU Acceleration Status:hax kernel module is not installed!
Tried this method, but still did not install successfully.
One: Download the Intel x86 emulator accelerator in the SDK Manager ... Later, although the display installed, but also get the SDK Directory Extras\intel\hardware_accelerated_execution_manager manual installation (parameter set to 1024M enough, You can reinstall it once you need to change the parameters.
II: Download the corresponding x86 mirror (Intel x86 Atom System image or Intel x86 atom_64 System image) in the SDK manager, and the corresponding version is what you use Andr x86 mirroring under OID versions (such as 5.1 4.4 4.3, etc.)
three: upgrading Android Tools four in SDK Manager
: When you create a new Android simulator in AvD Manager, Cpu/abi should choose x86 (or x86 _64), and then emulated performance should choose the use host GPU

After installation, then set Snap to unchecked, use host to select, and then start run again, the result has a problem:

Solution:

You'll need to actually install the Intel HAXM in order to use it:

Windows

in your Android SDK folder, look in E Xtras\intel\hardware_accelerated_execution_manager\
Run intelhaxam-android.exe
Mac in

your Android SDK Directory look in the Extras/intel/hardware_accelerated_execution_manager subdirectory
Run the installer:

Mount the HAXM *.dmg file, then run the *.mpkg contained inside it
or
Execute $./silent_install.sh

That's a nasty mistake, check out the contents of Sdkmanager.

Update

Well, the HAXM version is up to date, so install it and try again-to remove the previous version first.

Finally saw this picture ... Touched Ing.

Run again-remember to run under the project directory

Ionic emulate Android

and see


Finally succeeded, really very tired ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.