Android source code environment construction

Android source code environment construction

reference:

1. Install Ubuntu16.4 system
2. Openjdk 8 installation

sudo apt-get install openjdk-8-jdk

use java -versioncheck version

001
3. Install all packages

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip

Source code download
According to the link above, here is the way to choose the local decompression method

Download link address: https://pan.baidu.com/s/1Jwsrb-zwrQO-HEHo5eo9Jg Extraction code: uu1j

Install the decompression tool and decompress

sudo apt-get install p7zip
7zr x android-8.1.0_r1.7z

There is one Sub Items Errors:1that can be ignored
Sub Items Errors

The directory after decompression is as follows:
Table of contents

compile asop code

1. Execution. build/envsetup.sh

build/envsetup.sh
2.lunch

Please add a picture description
3. Select 6, aosp_x86_64-eng, use the simulator to demonstrate

Please add a picture description
4.make

problems encountered

1. Prompt SSL error
Reference:

The error message is roughly as follows:

SSL errorClick the link above to modify

sudo vi /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security 

java.security
Delete the following content
Please add a picture description

2. QuickSearchBox_intermediates/with-local/classes.dexError
Reference:

The compilation path is caused by Chinese. Refer to the following link to change the path to English:

makeAfter success, the prompt is as follows:
success interface
Run emulator, the emulator window is as follows:
simulator

If you turn it off and then run it emulator, you still need to restart

. build/envsetup.sh
lunch

If there is no modification make, no modification is required.make

Add log to print on the framework

Referring to the link above, add the following log in the ActivitymethodonCreate

edit via vi

cd framework/base
find -name Activity.java
vi ./core/java/android/app/Activity.java

add log
add log

Go back to the root directory:

make framework
make systemimage

After that, emulatoropen the emulator, open several Activity, and filter the log:

filter log

illustrate

Android compilation related knowledge can refer to the official website:

1. envsetup.sh
Use envsetup.shthe script to initialize the environment:

source build/envsetup.sh

or

. build/envsetup.sh

2. lunch
Select lunchthe target to build with

Guess you like

Origin blog.csdn.net/u014084081/article/details/130778747
Recommended