ubuntu android environment configuration of Qt and some solutions to common problems

Prepare materials are:

1.

qt for android 5. × version, download the following address, can select a suitable machine model own version to download.

Address: http: //www.qt.io/download-open-source/#section-2

2.

jdk download and configure the environment

Address: http: //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Environment variable settings:

0》

Run the following commands, extract jdk packets to the path to the specified.

$ sudo mkdir /usr/lib/jvm

$ sudo tar -C /usr/lib/jvm -xzf jdk-7u55-linux-x64.tar.gz

1》

sudo gedit ./.bashrc

2》

Add a text editor to open the following lines:

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_31
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH

Note: This is a few lines added, you only need to modify the path in the first row to the path before you unpack jdk path.

Testing method:

java -version

3

android sdk download

Download: http: //www.cnblogs.com/bjzhanghao/archive/2012/11/14/android-platform-sdk-download-mirror.html

Where to find the ADT bundle corresponding to your machine model download.

After the extract to a directory can be.

4

Download android ndk

Download: http: //www.cnblogs.com/yaotong/archive/2011/01/25/1943615.html

The same extract to a directory.

Note that: NDK is the need to configure the environment variables, or else an error will not find Qt yo.

sudo gedit ~/.bashrc

Finally, add the following sentence in a text editor:

NDK = / home / Trikes / android / android NDK-r10d
export NDK

5

ant install

Download: http: //ant.apache.org/bindownload.cgi

After downloaded directly down the same extract to a directory.

It can also be installed directly from the command.

sudo apt-get install ant

Testing method:

ant -version

6

adb install

Direct command to install

sudo apt-get install adb

Test methods: adb devices

After installing the above prepared material, you can install the Qt.

Note that if the Qt Download Qt for android's.

Menu, select "Tools" ---- "Options" ---- "Android"

After setting the appropriate path, configuration for android Qt is completed.

Occasionally there will be some errors, the following way:

If you do not set the environment variable ndk, it will complain when packaging.

Also, because it is the Android package path manually configured, therefore, sometimes QtCreator not find android package platform. Sometimes because they can not release and error, simply set here under android version. Position as shown below:

Published 90 original articles · won praise 26 · Views 100,000 +

Guess you like

Origin blog.csdn.net/sky_person/article/details/50133361