Ubuntu 16.04 LTS 64-bit system for Android 6.0
sudo apt install git-core bison build-essential Curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl-d EV libwxgtk3.0-dev LIBXML2 libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools xsltproc zip G++-multi Lib Gcc-multilib lib32ncurses5-dev lib32readline6-dev libc6-dev-i386 x11proto-core-dev libx11-dev CCache Libgl1-mesa-dev Unzip python-imaging Lib32z1-dev |
Download and install OpenJDK
Ubuntu16 default use of the JDK is Openjdk8, and compile Android6.0 source code needs OPENJDK7, at this time through Apt-get download not openjdk7! Because Ubuntu 16 has removed it from the repository, the workaround is to manually add the repository and then download the installation: sudo add-apt-repository Ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install OPENJDK-7-JDK Java-version Javac-version Change the JDK version sudo update-alternatives--config java sudo update-alternatives--config javac |
Improve compilation efficiency
(1) Added at the end of the. bashrc file: Export Use_ccache = 1 or terminal input command: Echo export use_ccache=1 >> ~/.BASHRC (2) To improve compilation efficiency, set the compiler cache: Prebuilts/misc/linux-x86/ccache/ccache-m 50G |
Common errors
Git error
Git clone appears, unable to negotiate with 10.0.0.8:no matching key exchange Methodfound. Their offer:diffie-hellman-group1-sha1 Solve: Open the. bashrc file, type: Vim ~/.BASHRC in the terminal, and then write to the. bashrc file: Export git_ssh_command= ' Ssh-o kexalgorithms=+diffie-hellman-group1-sha1 ' |
Clang Link Error
Compile error recipe for target ' out/host/linux-x86/obj/lib/libart.so ' failed Solve: In the Android source file art/build/android.common_build.mk This file to find # Host. Art_host_clang: = False Ifneq ($ (Without_host_clang), true) # By default, the host builds use clang for better warnings. Art_host_clang: = true # change to Art_host_clang: = False endif |
Splashimage error: Vendor/letv/proprietary/hwconfig/bootlogo/android.mk:10:recipe for target ' splashimage ' failed
Python has a high version and needs to be replaced by a method: Find./vendor/letv/proprietary/hwconfig/bootlogo/-name ' logo_gen.py ' |xargs perl-pi-e ' s|tostring|tobytes|g ' |
Ubuntu 16.04 LTS