android源码编译
来源:互联网 发布:dz论坛整站源码 编辑:程序博客网 时间:2024/05/29 13:57
一.http://source.android.com/source/building-running.html
二.编译过程中出现问题
1.<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
<built-in>:0:0: 附注: 这是先前定义的位置
cc1plus: all warnings being treated as errors
修改build/core/combo/HOST_linux-x86.mk 61行,将
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
修改成
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
2.In file includedfrom external/oprofile/libpp/arrange_profiles.cpp:24:0:
external/oprofile/libpp/format_output.h:94:22: error: reference‘counts’ cannot be declared ‘mutable’ [-fpermissive]
make: ***[out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o]Error 1
解决办法:
external/oprofile/libpp/format_output.h
把:
mutable counts_t & counts;
改为:
counts_t & counts
3.
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] 错误 1
gedit external/gtest/include/gtest/internal/gtest-param-util.h
添加
#include <cstddef>
4.make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] 错误 1
gedit external/llvm/llvm-host-build.mk
#编译不过
LOCAL_LDLIBS:=-lpthread -ldl
5
在工程根目录下,打开下面的makefile文件:
$ vi frameworks/compile/slang/Android.mk
在打开的makefile文件中按照下面更改:
#local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
6.编译 MAKE SDK
Package SDK: out/host/linux-x86/sdk/android-sdk_eng.wangwei_linux-x86.zip
development/build/sdk.atree:229: couldn't locate source file: framework/layoutlib-tests.jar
development/build/sdk.atree:230: couldn't locate source file: system/app/ConnectivityTest.apk
development/build/sdk.atree:231: couldn't locate source file: system/app/GpsLocationTest.apk
sdk/build/tools.atree:47: couldn't locate source file: usr/share/pc-bios/bios.bin
sdk/build/tools.atree:48: couldn't locate source file: usr/share/pc-bios/vgabios-cirrus.bin
sdk/build/tools.atree:146: couldn't locate source file: framework/ddmlib-tests.jar
sdk/build/tools.atree:147: couldn't locate source file: framework/ninepatch-tests.jar
sdk/build/tools.atree:148: couldn't locate source file: framework/common-tests.jar
sdk/build/tools.atree:149: couldn't locate source file: framework/sdklib-tests.jar
sdk/build/tools.atree:150: couldn't locate source file: framework/sdkuilib-tests.jar
make: *** [out/host/linux-x86/sdk/android-sdk_eng.wangwei_linux-x86.zip] 错误 44
解决方法如下:
$ source build/envsetup.sh
initialize some commands for android compile system
$lunch sdk-eng
The item have not been listed in the printed console list, but it still support the function
$make sdk
7.编译过SDK后 运行模拟器
/home/zhujc/androidSource/out/host/linux-x86/bin/emulator
- $cd out/host/linux-x86/sdk/android-sdk_eng.xxx_linux-x86/tools
- $./android list targets
- Available Android targets:
- ----------
- id: 1 or "android-14"
- Name: Android 4.0
- Type: Platform
- API level: 14
- Revision: 2
- Skins: QVGA, WSVGA, HVGA, WVGA854, WXGA720, WQVGA432, WVGA800 (default), WQVGA400, WXGA800
- ABIs : armeabi-v7a
- $./android create avd -t 1 -n ics
- Auto-selecting single ABI armeabi-v7a
- Android 4.0 is a basic Android platform.
- Do you wish to create a custom hardware profile [no]
- Created AVD 'ics' based on Android 4.0, ARM (armeabi-v7a) processor,
- with the following hardware config:
- hw.lcd.density=240
- vm.heapSize=24
- hw.ramSize=512
- $./emulator -avd testYM
8.修改LUANCHER2下面一张图片资源
编译模块之后,SDK也被清除,重新编译SDK后才可以运行模拟器
编译:
source build/envsetup.sh
mmm packages/apps/Launcher2
lunch sdk-eng
make sdk
然后再进入
cd out/host/linux-x86/sdk/android-sdk_eng.xxx_linux-x86/tools
./emulator -avd testYM
- 编译android源码5---编译android源码
- android源码编译,模块编译
- android源码的编译
- Android源码编译
- Android源码编译反思
- Android源码编译
- Android源码编译反思
- android 源码编译
- Android 源码下载编译
- android 源码编译
- Android源码编译
- Android 源码编译
- android 源码编译
- ubuntu编译android 源码
- 编译android源码
- android源码编译
- 编译android源码
- 编译android源码
- 关于二分匹配的基础图论知识
- System.in与System.out
- XML编程的解析过程
- 缓存与程序内存分布
- Android_NDK_开发环境搭建及HelloC
- android源码编译
- 判断单链表中是否存在环及查找环的入口点
- 简单的使用SQLite本地数据库
- Oracle 11g新特性-分区
- 轻量级的webserver
- Android Activity的生命周期
- 开始学习机器学习
- 自定义编译gdal库
- 关于cocos2d-x中的动画类