android2.3 源码编译及导入模拟器

编译环境Ubuntu11.04 32位机器

下载完代码后,进行make$cd ~/myAndroidsource
$make
却出现了如下错误:
build/core/main.mk:73: You are attempting to build on a 32-bit system.
build/core/main.mk:74: Only 64-bit build environments are supported beyond froyo/2.2.
这是因为froyo/2.2默认只支持64-bit,看到有些网友还要去下载64-比他的操作系统,很是麻烦,于是通过不断搜索资料终于解决,
解决办法:
需要进行如下修改即可,
将
./external/clearsilver/cgi/Android.mk
./external/clearsilver/java-jni/Android.mk
./external/clearsilver/util/Android.mk
./external/clearsilver/cs/Android.mk
四个文件中的
LOCAL_CFLAGS += -m64 
LOCAL_LDFLAGS += -m64 
注释掉,或者将“64”换成“32”
LOCAL_CFLAGS += -m32 
LOCAL_LDFLAGS += -m32 

然后,将
./build/core/main.mk 中的
ifneq (64,$(findstring 64,$(build_arch))) 
改为:
ifneq (i686,$(findstring i686,$(build_arch))) 

1、进入到源码文件夹下 执行make命令开始编译


target thumb C: libwnndict <= packages/inputmethods/OpenWnn/libs/libwnnDictionary/engine/ndldic.c 
target thumb C: libwnndict 
<= packages/inputmethods/OpenWnn/libs/libwnnDictionary/engine/ndrdic.c 
target thumb C: libwnndict 
<= packages/inputmethods/OpenWnn/libs/libwnnDictionary/engine/necode.c 
target thumb C: libwnndict 
<= packages/inputmethods/OpenWnn/libs/libwnnDictionary/engine/ndcommon.c 
target thumb C: libwnndict 
<= packages/inputmethods/OpenWnn/libs/libwnnDictionary/engine/nj_str.c 
target SharedLib: libwnndict (out
/target/product/generic/obj/SHARED_LIBRARIES/libwnndict_intermediates/LINKED/libwnndict.so) 
target Non
-prelinked: libwnndict (out/target/product/generic/symbols/system/lib/libwnndict.so) 
target Strip: libwnndict (out
/target/product/generic/obj/lib/libwnndict.so) 
Generated: (out
/target/product/generic/android-info.txt) 
Target system fs image: out
/target/product/generic/obj/PACKAGING/systemimage_unopt_intermediates/system.img 
Install system fs image: out
/target/product/generic/system.img 
Target ram disk: out
/target/product/generic/ramdisk.img 
Target userdata fs image: out
/target/product/generic/userdata.img 
Installed file list: out
/target/product/generic/installed-files.txt

出现上面的提示信息说明编译已经完成,同时会发现在代码目录下多了一个out目录。

2、安装Android模拟器android-sdk-linux_x86

  到google网站下载http://developer.android.com/sdk/index.html页面下载android-sdk_r04-linux_x86.tgz到/usr/local/并解压,加压后文件夹/usr/local/android-sdk-linux_86/tools/中包含有 emulator模拟器。

  编辑/etc/profile添加模拟器执行环境变量

# Android  emulator
PATH
= ”$PATH: / home / lvs / out / host / linux - x86 / bin”
ANDROID_PRODUCT_OUT
=/ home / lvs / out / target / product / generic
export ANDROID_PRODUCT_OUT
dong@ubuntu: ~/ out / target / product / generic#  / usr / local / android - sdk - linux_86 / tools / emulator  - image system.img  - data userdata.img  - ramdisk ramdisk.img



你可能感兴趣的:(android,image,ubuntu,Google,System,Build)