这篇文章主要介绍了解决Android 源码编译错误的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
如下所示:
Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.2-a26 'Carnac' (291201 fcd657165d2fd6dcf1bf4c3002c9c8f75383e815 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
在文件/prebuilts/sdk/tools/jack-admin中修正-Xmx参数。
1、修改变量JACK_SERVER_VM_ARGUMENTS,添加参数 -Xmx2048M
JACK_SERVER_VM_ARGUMENTS="${JACK_SERVER_VM_ARGUMENTS:=-Dfile.encoding=UTF-8 -XX:+TieredCompilation -mx2048M}"
2、进一步修正重启参数(该步骤可以省略)
找到jack-admin中的start-server语句,直接在里面增加:
start-server)
isServerRunning
RUNNING=$?
if [ "$RUNNING" = 0 ]; then
echo "Server is already running"
else
echo "before to start-server,JACK_SERVER_VM_ARGUMENTS=" $JACK_SERVER_VM_ARGUMENTS
JACK_SERVER_COMMAND="java -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS-Xmx2048M -cp $LAUNCHER_JAR $LAUNCHER_NAME"
echo "Launching Jack server" $JACK_SERVER_COMMAND
(
补充知识:编译android 7.0 出现Try increasing heap size with java option '-Xmx'错误解决方案
出现这个错误是由于电脑内存不足,在命令行分别执行以下三条语句,然后继续编译
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server
以上这篇解决Android 源码编译错误的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程学习网。
本文标题为:解决Android 源码编译错误的问题
基础教程推荐
- IOS获取系统相册中照片的示例代码 2023-01-03
- MVVMLight项目Model View结构及全局视图模型注入器 2023-05-07
- iOS开发使用XML解析网络数据 2022-11-12
- Android开发Compose集成高德地图实例 2023-06-15
- iOS开发 全机型适配解决方法 2023-01-14
- Android实现短信验证码输入框 2023-04-29
- iOS中如何判断当前网络环境是2G/3G/4G/5G/WiFi 2023-06-18
- iOS Crash常规跟踪方法及Bugly集成运用详细介绍 2023-01-18
- Android Compose自定义TextField实现自定义的输入框 2023-05-13
- Flutter进阶之实现动画效果(三) 2022-10-28