[ 29% 17593/59326] Ensure Jack server is installed and started
FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
Writing client settings in /home/nikos/.jack-settings
Installing jack server in "/home/nikos/.jack-server"
Communication error with Jack server (58), try 'jack-diagnose' or see Jack server log
Failed to contact Jack server: Problem reading /home/nikos/.jack-server/client.pem. Try 'jack-diagnose'
Failed to contact Jack server: Problem reading /home/nikos/.jack-server/client.pem. Try 'jack-diagnose'
[ 29% 17593/59326] Notice file: packages/apps/CertInstaller/NOTICE -- out/target/product/h6168/obj/NOTICE_FILES/src//system/app/CertInstaller/CertInstaller.apk.txt
[ 29% 17593/59326] Aidl: android-support-v4 <= frameworks/support/v4/java/android/support/v4/os/IResultReceiver.aidl
[ 29% 17593/59326] Aidl: android-support-v4 <= frameworks/support/v4/java/android/support/v4/media/session/IMediaSession.aidl
[ 29% 17593/59326] Protoc: out/target/common/obj/JAVA_LIBRARIES/sap-api-java-static_intermediates/src/proto/Proto.stamp <= hardware/ril/librilutils/proto/sap-api.proto
[ 29% 17593/59326] target Strip: fuelgauged_static (out/target/product/h6168/obj_arm/EXECUTABLES/fuelgauged_static_intermediates/fuelgauged_static)
[ 29% 17593/59326] host Java: cts-tradefed (out/host/common/obj/JAVA_LIBRARIES/cts-tradefed_intermediates/classes)
[ 29% 17593/59326] Compiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
[0;31m#### make failed to build some targets (48:53 (mm:ss)) ####[00m
---------------------------
修改prebuilts/sdk/tools/jack-admin:
JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_ VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME"
java虚拟机内存大小自由分配;
JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_ VM_ARGUMENTS -Xmx4096m -cp $LAUNCHER_JAR $LAUNCHER_NAME"
手动分配4096 ;
一、8G RAM如何编译Android N
1.在 ~/.bashrc中添加
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xms2560m"
2. 修改 ~/.jack-server/config.properties
jack.server.max-service=2
3. 修改scm.sh文件
make -j2
二、一台服务器如何支持同时编译多个 Android N工程
1. 修改~/.jack-server/config.properties中tcp端口
jack.server.service.port=8086
jack.server.admin.port=8087
2. 修改~/.jack-settings中tcp端口
SERVER_PORT_SERVICE=8086
SERVER_PORT_ADMIN=8087
要求:
- 一个服务器中, 每个帐号有唯一的port
- jack.server.service.port 和SERVER_PORT_SERVICE 的值一样
jack.server.admin.port和SERVER_PORT_ADMIN 值一样
一般遇到编译报错后, 请按如下步骤操作:
(1). jack-admin kill-server
(2). remove $JACK_HOME(default ~/.jack-server)
(3). rebuild
修改方法:
同时修改$HOME/.jack-settings和$HOME/.jack-server/config.properties中的端口号(比如都改为8086/8087),方可支持多用户同时编译。
目前可以先用这个方法解决问题,后面看google是否会对JACK做优化。有任何问题,请大家拍砖!