Android Building Records

the following operation basic on google original source codes of android2.3.
====================================
build android:
refer to the android web site!
*http://source.android.com/source/downloading.html


1) download source codes.
2) install compile tools.
3) type"make -jN","N" is the double time of total numbers of cpu core.


====================================
build android sdk


basic on the step of build-android


1)type "make sdk -jN"


=====================================
module build


basic onf the step of build-android


1) source /build/envsetup.sh
*this is important!we can use lots of other commands after running this script.


2) e.g:
mmm frameworks/base/services/java


3) package the system image
make -jN


====================================
Kernel build


the dufault kernel image which was used by emulator is in the folder path:
"prebuild/android-arm/kernel/vmlinux-qemu"


*refer to : http://source.android.com/source/building-kernels.html


1) download linux kernel sources
1. mkdir kernel
2. cd kernel
3. e.g : git clone https://android.googlesource.com/kernel/goldfish.git
* after resolving done,the git clone seemed to be empty.
solution:
from :http://stackoverflow.com/questions/9004192/the-git-clone-is-empty-why-this-happens
-----------------------------------------
git branch -a
* master
 remotes/origin/HEAD -> origin/master
 remotes/origin/android-msm-2.6.35
 remotes/origin/master
-----------------------------------------
and then checkout the branch
-----------------------------------------
% git checkout android-msm-2.6.35
Checking out files: 100% (33866/33866), done.
Branch android-msm-2.6.35 set up to track remote branch android-msm-2.6.35 from origin.
Switched to a new branch 'android-msm-2.6.35'
------------------------------------------
4. export PATH=prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
$ make goldfish_defconfig
$ make


=============================================
emulator
refer to : http://bbs.chinaunix.net/thread-3647613-1-1.html
1. config the enviroment parameters
2. type "emulator -system system.img -data userdata.img -ramdisk ramdisk.img -kernel kernel/godifhs/arch/arm/boot/zImage"







对于Android Studio一直处于Building的问题,有以下几个可能的原因和解决方法: 1. Gradle的配置问题:Android Studio使用Gradle作为构建系统,如果Gradle的配置存在问题,就会导致一直处于Building状态。解决方法是检查项目的Gradle文件(build.gradle)是否正确配置,特别是依赖库的版本和路径是否正确。 2. 依赖库下载失败:在构建过程中,Android Studio需要下载一些依赖库,如果网络不稳定或者依赖库的服务器不可用,就会导致一直处于Building状态。解决方法是检查网络连接是否正常,并尝试手动下载依赖库并放置到本地仓库,或者更换使用其他可用的依赖库。 3. 项目文件夹路径过长:如果项目的文件夹路径过长,会导致Android Studio在构建过程中遇到问题,无法正常运行。解决方法是将项目文件夹路径缩短,避免使用过长的文件夹名或多层嵌套的文件夹结构。 4. 编译过程中遇到错误:如果在编写代码或者导入项目的过程中存在错误,Android Studio会显示Building状态,但实际上是在尝试编译并显示错误信息。解决方法是检查代码或项目导入的过程中是否存在错误,并修复这些错误。 总之,如果Android Studio一直处于Building状态,需要仔细检查Gradle的配置、依赖库下载、项目文件夹路径以及编译过程中的错误等各个方面,找出具体原因并进行相应的解决。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值