android 编译环境修复

sudo apt install lib32z1

sudo apt install bc 

sudo apt install curl

sudo apt install python-pip

sudo apt install libswitch-perl

$ java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)

OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)


$ echo $PATH

/usr/lib/jvm/java-7-openjdk-amd64/bin:


/usr/lib/jvm/java-8-openjdk-amd64/bin

PATH=/opt/jdk1.7.0_65/bin:$PATH

Checking build tools versions...
************************************************************
You asked for an OpenJDK 7 build but your version is
java version "1.7.0_65" Java(TM) SE Runtime Environment (build 1.7.0_65-b17) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode).
************************************************************
build/core/main.mk:192: *** stop.  Stop.

Solution: before starting a clean android build set the JACK_SERVER_VM_ARGUMENTS to include -Xmx=4g, then stop and start the jack servermanually. Given you're in the main source tree of AOSP run the following:

[html]  view plain  copy
  1. export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"  
  2. ./prebuilts/sdk/tools/jack-admin kill-server  
  3. ./prebuilts/sdk/tools/jack-admin start-server  

for cm you can use 

[html]  view plain  copy
  1. export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"  
  2. jack-admin kill-server && jack-admin start-server  


猜你喜欢

转载自blog.csdn.net/micro9981/article/details/79688102