编译环境:(1)ubuntu15.04(2)jdk1.6
JDK环境设置:
export JAVA_HOME=/home/zr/jdk1.6.0_45
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
错误1.
zr@zr:~/androidcode$ make
build/core/main.mk:45: *******************************************************************************
build/core/main.mk:46: * You are using version 4.0 of make.
build/core/main.mk:47: * Android can only be built by versions 3.81 and 3.82.
build/core/main.mk:48: * see https://source.android.com/source/download.html
build/core/main.mk:49: *******************************************************************************
build/core/main.mk:50: *** stopping。 停止。
方法:安装3.82
在make-3.8.2目录下
./configure
make
make install
错误2:
root@zr:/home/zr/androidcode# make
/bin/bash: bison: 未找到命令
build/core/config.mk:340: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com。 停止。
方法
sudo apt-get install bison
在进行Android 源码编译的时候,出现"make: *** [out/target/common/obj/PACKAGING/checkapi-current-timestamp] 错误 38 "信息
解决方法如下:
make update-api
make
错误4:
make: *** [out/target/common/obj/APPS/CMParts_intermediates/classes-full-debug.jar] 错误
解决方法
只需打如下命令 即可:$ make clobber $ make 就可以啦!
错误5:
error libGL.so: cannot open shared object file: No such file or directory
Failed to load libGL.so
解决方法
sudo apt-get install libgl1-mesa-dev
cd /usr/lib/i386-linux-gnu/mesa/sudo ln -s libGL.so.1.2 libGL.so sudo ln -s libGL.so.1.2 /usr/lib/libGL.so
错误6:
emulator:未找到命令
方法
export PATH=$PATH:~/Android/out/host/linux-x86/bin
export ANDROID_PRODUCT_OUT=~/Android/out/target/product/generic
错误7:
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
方法
source build/envsetup.sh
lunch sdk-eng
然后再执行
emulator
可以启动模拟器
错误8:
[out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] 错误 2
sudo apt-get install libswitch-perl
错误9:
模块编译:“all 没有什么可以为的”错误,可以使用以下命令:
1,source./build/envsetup.sh
2, lunch10
3, touchpackage/apps/Settings(更新)
4,mmmpackages/apps/Settings