Mac OS X 10.10bc31编译uc os ii软件的问题,怎么解决

Android源码编译
android源码编译网上很多教程,但所有的教程,发源地都是官网,所以,请在看到这篇文章的朋友,可以先移步官网。
关于源码下载和编译:
我们知道,android是基于Linux内核的系统,但Linux内核代码是区分大小写的(猜测当时是基于一个区分大小写的文件系统开发的),所以存储Android源码的磁盘所在的文件系统一定是需要区分大小写,即大小写敏感的,才可以进行编译构建。
Android简介:
使用Mac的朋友应该都知道,OS X的文件系统是大小写不敏感的,即不区分大小写。Mac早期是基于Mach内核,新的
OS X系统是基于和内核,新的结合&、和Mac
OS 9的元素。它的最底层建基于基础,其代码被称为Darwin
2011年以前苹果称自己的OS为“Mac
OS X”,发布Mac OS X v10.7后,苹果称其为“OS X Lion”,其后的系统均改名为“OS X”
OS X简介:
言归正传:
1、源码tags以及tag所支持的硬件设备说明
初始化OS X Android源码Build环境
1、创建一个支持区分大小写的磁盘镜像
# hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
2、磁盘镜像扩容(如果编译源码时,磁盘空间不够则需要使用到)
# hdiutil resize -size &new-size-you-want&g ~/android.dmg.sparseimage
3、挂载该大小写敏感的磁盘镜像到目录/Volumes/android(OS X挂载该镜像后,才支持在OS X中操作该磁盘)
hdiutil attach ~/android.dmg -mountpoint /Volumes/android
注意:如果系统使用hdiutil
create创建镜像时,生成的镜像文件为android.dmg.sparsefile(不是android.dmg),则需要使用~/android.dmg.sparsefile替换~/android.dmg
4、卸载挂载到目录/Volumes/android的大小写敏感的磁盘镜像文件~/android.dmg
hdiutil detach /Volumes/android
注:为了方便挂载和卸载磁盘镜像文件,你可以写两个方法命令,将这两个方法命令加如到~/.bash_profile,例如:
命令行中执行mountAndroid挂载磁盘镜像&~/android.dmg到目录/Volumes/android:
# mount the android file image
function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }
命令行中执行umountAndroid卸载挂载到目录/Volumes/android的磁盘镜像~/android.dmg:
# unmount the android file image
function umountAndroid() { hdiutil detach /Volumes/android; }
5、jdk安装
据官网描述,master和5.0.x需要Java 7,在Mac OS上使用
&Android Gingerbread (2.3
- 2.3.2)到 KitKat(4.4 - 4.4.4),使用Java 6版本的Java JDK
注:Oracle仅仅在Java7时才开始提供基于Mac OS的JDK,所以,Java6时,并未提供基于Mac OS的JDK1.6版本
所以,Apple给开发者提供了基于Java6的JDK1.6版本的开发包,下载地址:
后续步骤,引用官方:
Master branch
To build the latest source in a Mac OS environment, you will need an Intel/x86 machine running Mac OS X v10.8 (Mountain Lion) or later, along with Xcode 4.5.2 or later including the Command Line Tools.
Branch 5.0.x and earlier branches
To build 5.0.x and earlier source in a Mac OS environment, you will need an Intel/x86 machine running Mac OS X v10.8 (Mountain Lion), along with Xcode 4.5.2 and Command Line Tools.
Branch 4.4.x and earlier branches
To build 4.2.x and earlier source in a Mac OS environment, you will need an Intel/x86 machine running Mac OS X v10.6 (Snow Leopard) or Mac OS X v10.7 (Lion), along with Xcode 4.2 (Apple's Developer Tools). Although Lion does not come with a JDK, it should install
automatically when you attempt to build the source.
The remaining sections for Mac OS apply only to those who wish to build earlier branches.
Branch 4.0.x and all earlier branches
To build android-4.0.x and earlier branches in a Mac OS environment, you need an Intel/x86 machine running Mac OS X v10.5 (Leopard) or Mac OS X v10.6 (Snow Leopard). You will need the Mac OS X v10.5 SDK.
注:我使用的Xcode版本是Xcode5.1.1
Installing required packages
Install Xcode from&. We recommend version 3.1.4 or newer (e.g.,
gcc 4.2). Version 4.x could cause difficulties. If you are not already registered as an Apple developer, you will have to create an Apple ID in order to download.
Install MacPorts from&.
Note: Make sure that&/opt/local/bin&appears in your path BEFORE&/usr/bin.
If not, add
export PATH=/opt/local/bin:$PATH
to your&~/.bash_profile.
Note: If you do not have a&.bash_profile&file in your home directory, create one.
Get make, git, and GPG packages from MacPorts:
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git gnupg
If using Mac OS X v10.4, also install bison:
$ POSIXLY_CORRECT=1 sudo port install bison
Reverting from make 3.82
For versions of Android before ICS, there is a bug in gmake 3.82 that prevents android from building. You can install version 3.81 using MacPorts by taking the following steps:
Edit&/opt/local/etc/macports/sources.conf&and add a line that says
file:///Users/Shared/dports
above the rsync line. Then create this directory:
$ mkdir /Users/Shared/dports
In the new&dports&directory, run
$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
Create a port index for your new local repository:
$ portindex /Users/Shared/dports
Finally, install the old version of gmake with
$ sudo port install gmake @3.81
Setting a file descriptor limit
On Mac OS, the default limit on the number of simultaneous file descriptors open is too low and a highly parallel build process may exceed this limit.
To increase the cap, add the following lines to your&~/.bash_profile:
# set the number of open files to be 1024
ulimit -S -n 1024
Optimizing a build environment (optional)
Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed up rebuilds. This works very well if you use&make clean&often,
or if you frequently switch between different build products.
Put the following in your&.bashrc&(or equivalent):
export USE_CCACHE=1
By default the cache will be stored in&~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your&.bashrc&file
export CCACHE_DIR=&path-to-your-cache-directory&
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
On Mac OS, you should replace&linux-x86&with&darwin-x86:
prebuilts/misc/darwin-x86/ccache/ccache -M 50G
When building Ice Cream Sandwich (4.0.x) or older, ccache is in a different location:
prebuilt/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
Next: Download the source
Your build environment is good to go! Proceed to&.
Android源码下载:
1、下载指定tag的android
编译构建:
遇到的问题:
接着可以开始编译了,但是没过多久又开始报错了。你会发现它提示:
SyntaxError: Unable to find any JNI methods for org/chromium/ui/Clipboard.
这个也是Xcode版本是高版本的问题。在github有个错误的解决方案:
提醒一下,路径为:external/chromium_org/base/android/jni_generator/jni_generator.py
问题解决后,开始编译构建:
构建成功图:
参考链接:
注意:我在按如上的参考链接下,始终未能成功编译过,只是借鉴了里面的遇到的问题的解决办法,后面回归Xcode5.1.1编译通过,一开始用的Xcode6.3.1,始终未能编译过
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:123298次
积分:1480
积分:1480
排名:第17352名
原创:19篇
转载:21篇
评论:102条
(6)(8)(1)(2)(1)(3)(1)(2)(2)(1)(1)(2)(3)(1)(1)(1)(1)(2)(1)Mac OS X 10.10编译软件的问题,怎么解决_百度知道
Mac OS X 10.10编译软件的问题,怎么解决
能,国内是不支持Linux的,软件包管理不一样。 GNU软件如果有相应的源代码可以自行编译安装,二进制不能直接用。至于很多商业软件
知道智能回答机器人
我是知道站内的人工智能,可高效智能地为您解答问题。很高兴为您服务。
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁mac&os&xcode6.1.1&编译android&4.4.2源码&make版本兼容问题解决
目的:使用mac的os X 操作系统,编译android4.4.2源码
操作环境:
&& os x yosemite 10.10
&& xcode 6.1.1
兼容问题:
由于我使用的mac10.10&
xcode6.1,xcode6.1仅支持&MacOSX10.9.sdk
MacOSX10.10.sdk&,我编译的安卓源码是4.4.2,支持低版本的sdk:10.6、7、8,就是4.4.2
不支持对xcode6.1&,而更好的支持是5.0.1。
一般中文网站上有各种关于对Xcode6.1的兼容性修改,各种文件的修改,还有各种问题的解决。可是我试试了一直不好使,编译中总能遇到莫名的未知问题,可能是我比较笨,因此我去国外网站又都学了学,国外一般都是使用5.0.1。。。因此我的思路改变一下,安装xcode两个版本6.1.1最新版本和5.0.1老版本,可自由切换,当编辑4.4.2时,切换到5.0.1xcode上就可以了。
解决过程具体操作如下:
xcode,commandlinetools等工具下载地址:
在上面地址下载xcode5.0.2,和commandlinetools
一、安装xcode5.0.2
在application中,新建文件夹xcode5.0.2
,将dmg文件拖拽到新建的文件夹中,等一会就安装成功了,如下图:
二、安装commandlinetools
安装commandlinetoolsosx10.10forxcode6.1.1commadxcode
,(这个软件可以用来自由切换xcode的版本,也能升级和控制xcode工具)通过在shell中输入
xcode-select -p& 有显示
/Applications/Xcode.app/Contents/Developer代表完成安装。
(command&line&tools
说明地址:)
三、切换xcode版本
执行一下语句,切换默认xcode到5.0.2,以方便执行安卓的编译工作
sudo xcode-select -s
/Applications/Xcode5.0.2/Xcode.app/Contents/Developer
执行这个命令查看当前xcode的版本
gcc --version
最后、执行make就可以了
这样,当前就使用5.0.2的版本编译了,而且也可以随时切换到6.0.1。。。
完成上述切换到5.0.2后。啦啦啦啦,编译就可以顺利通过了。
-----------
顺便简述编辑过程(其他的操作就参考官方网站了):
进入到下载的android代码目录
/Volumes/android/source_workspace
执行source build/envsetup.sh
再次执行lunch aosp_arm-eng
最后执行&make
我的mac是高配,i7cpu
16g内存,因此我运行了-j4
我是晚上编译的,我在睡觉,估计编译了三个小时左右。我猜的。。。、
-----------
不明白的,可以留言。。。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 chrome os 编译 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信