android O 编译及运行

1 编译Android7.0+更改Java heap Size

Android7.0(也就是Android N)上默认使用JACK编译器,当内存较小的机器编译时可能会出现:

Out of memory error (version 1.2-rc4 ‘Carnac’ (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option ‘-Xmx’.

此时需要更改Java heap Size,有2种方式任选:

方法1(不需要make clean,export后即可继续make xxxx):

export JACK_SERVER_VM_ARGUMENTS=”-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m”
out/host/linux-x86/bin/jack-admin kill-server
out/host/linux-x86/bin/jack-admin start-server

方法2:

修改源码目录下prebuilts/sdk/tools/jack-admin文件的JACK_SERVER_VM_ARGUMENTS变量,
添加-Xmx4096M(这个根据你自己的内存情况),然后make clean,make -j48重新编译。

2 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7’ not found (required by emulator64-x86)

Leave libQt5Core.so.5 in /home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/. Qt does not like to be moved around, it makes it lose where the plugins are stored. In your case it might end up trying to load Qt 5.5 plugins.

Set LD_LIBRARY_PATH to /home/wanyu/work/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/.

3.解决命令启动Android模拟器出现lib64OpenglRender.so: cannot open shared object file问题

export LD_LIBRARY_PATH=~/Android/sdk/tools/lib64:$LD_LIBRARY_PATH

4模拟器跑步起来

4.1

$ repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r34
$ repo sync -j12

4.2

https://android.googlesource.com/platform/frameworks/native/+/3adf9e1403bee30d1ef79c3a8cf310292df4745f
cdframeworks/native git fetch https://android.googlesource.com/platform/frameworks/native refs/changes/50/471850/1 && git cherry-pick FETCH_HEAD
$ cd ../../

4.3

sourcebuild/envsetup.sh lunch aosp_x86-eng
$ make -j4

4.4

emulator

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值