Ubuntu14.04系统下编译Android2.3.4遇到的问题总结

来源:互联网 发布:改变手机字体大小软件 编辑:程序博客网 时间:2024/06/04 01:19
1.问题描述:
$  git push origin master
To git@git1.eu1.frbit.com:hbrosuru.git
! [rejected]        ab68c0485d -> master (non-fast-forward)
error: failed to push some refs to 'git@git1.eu1.frbit.com:hbrosuru.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决办法:#git push --force origin master:master

2.问题描述:
Error:
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1


解决办法:
cd external/srec
wget "https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff"
patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
cd ../..


3.问题描述:
No rule to make target `out/target/product/generic/obj/lib/libcamera.so'

解决办法:
在/home/jack/Downloads/Android/Android-2.3.4/frameworks/base/services/camera/libcameraservice下,修改Android.mk文件,
修改如下:USE_CAMERA_STUB:=false  修改为true

LOCAL_PATH:= $(call my-dir)

# Set USE_CAMERA_STUB if you don't want to use the hardware camera.

# force these builds to use camera stub only
ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)
  USE_CAMERA_STUB:=true
endif

USE_CAMERA_STUB:=true       

ifeq ($(USE_CAMERA_STUB),)
  USE_CAMERA_STUB:=false
endif


4.问题描述:
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC 
contains: external/webkit/WebCore/bindings/scripts /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/libsite_perl .) at external/webkit/Web  Core/dom/make_names.pl line 38.
BEGIN failed--compilation aborted at external/webkit/WebCore/dom/make_names.pl line 38.

解决办法:
sudo apt-get install libswitch-perl


5.问题描述:
out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/src/accessors.o]错误1

解决办法:
在用Ubuntu 14.04 64bit系统编译android 2.3代码时,一直都编译不过去,不知到什么原因,后来发现好象是因为gcc和g++为4.7与android 2.3 code 不兼容,因此需要为g++ 和 gcc 降级,同时降为4.4.7。 g++ 和 gcc版本必须一致,否则会报错。

sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4

然后执行一下命令进行版本切换,

切换gcc:

   rm -rf /usr/bin/gcc

  sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc

  然后使用 gcc -v 检查版本。

切换g++ 步骤一样。

然后继续编译,期间可能还发生g++ selected multilib '32' not installed的错误,需要:
sudo apt-get install g++-4.4-multilib
然后继续编译


编译成功截图:



0 0
原创粉丝点击