In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to build HTML5 mobile application framework ionic under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Ionic is the most potential HTML5 mobile application development framework at present. Build applications through SASS, which provides a number of UI components to help developers develop powerful applications. It uses the JavaScript MVVM framework and AngularJS to enhance the application. Provide two-way binding of data, and use it as a common choice for both Web and mobile developers.
Install nodejs
Download the latest stable version of Node.js installation package on Node.js official website
Go to the Downloads directory and extract the file
Cd Downloadstar-xvf node-v6.10.3-linux-x64
Enter the command to move the folder to the general software directory opt
Sudo mv node-v8.0.0-linux-x64 / opt/
Install npm and node commands to system commands
Sudo ln-s / opt/node-v6.10.3-linux-x64/bin/node / usr/local/bin/nodesudo ln-s / opt/node-v6.10.3-linux-x64/bin/npm / usr/local/bin/npm
Enter node-v and npm-v to verify that the installation is successful
Build JAVA environment
Download the jdk-8u131-linux-x64.tar.gz file
Decompression
Tar-zxvf jdk-8u131-linux-x64.tar.gz
Get the jdk1.8.0_131 folder
Move to opt
Mv jdk1.8.0_131 / opt/java to build Android Environment
Download the android-sdk_r24.4.1-linux.tgz file
Decompression
Tar-zxvf android-sdk_r24.4.1-linux.tgz
Get the android-sdk-linux folder
Move to the opt directory
Mv android-sdk-linux / opt
Update
Android-sdk-linux/tools/android update sdk--no-ui
This is to update all the sdk, or you can specify a version update, as follows:
Android update sdk-u-filter platform-tools,android-25,extra-android-support
Indicates that only packages of platform-tools,android-25 and support are obtained
Configure environment variables
Enter the profile file
Vim / etc/profile
Add at the end of the file
Export JAVA_HOME=/opt/java/jdk1.8.0_131export ANDROID_HOME=/opt/android-sdk-linuxexport PATH=$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH install ionic
Install cordova and ionic
Npm install-g cordova ionic
After the installation is complete, run ionic info to see if the installation is successful. If "ionic: command not found" appears, you can run the following command:
Npm config set prefix / usr/local
Then reinstall cordova and ionic Note: if the installation is too slow, you can configure a domestic Taobao image to install
Npm config set registry https://registry.npm.taobao.org
/ / after configuration, you can verify whether npm config get registry / / or npm info express "`is successful in the following ways
Create an ionic project
Ionic start mynewapp blank
Go to the project root directory and run the project
Problems that ionic cordova start android may encounter
Question 1: No installed build tools found. Install the Android build tools version 19.1.0 or higher. Solution: run the command:
Android update sdk-u-a build-tools-23.0.3
Problem 2: 64-bit linux system may have aapt-related problem resolution when build android: execute the following command:
/ opt/android-sdk-linux/build-tools/aapt
After execution, "- bash:. / aapt: / lib/ld-linux.so.2: bad ELF interpreter: No such file or directory" appears because some programs and tools in android-sdk are 32-bit, and are not compatible with 64-bit environment. Then install the 32-bit package. The installation method is to select yum to find out which package it is, and then install the package:
Yum whatprovides ld-linux.so.2
Then install the 32-bit version of glibc and continue to run the same problem, just install the 32-bit version according to the above method. Problem 3: slow in build android solution: because you need to download gradle, it will be very slow. You can download gradle first, download address: http://services.gradle.org/distributions/, select the corresponding version to download, here I choose is gradle-3.3-all.zip. After downloading, there is no need to extract it, put it in the "/ home/user/.gradle/wrapper/dists" directory. If it's still slow, go to the "platform/android" directory of your ionic project and execute the following command:
. / gradlew
Thank you for reading! This is the end of the article on "how to build HTML5 mobile application framework ionic under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.