Android7.1编译出现jack server端口配置错误的问题

编译环境:

Android 7.1

ubuntu16.04

下面是编译出现的错误,[ninja_wrapper] Error 1

Created filesystem with 25/2048 inodes and 1186/8192 blocks
out/target/product/msm8953_64/persist.img maxsize=34197504 blocksize=135168 total=4858292 reserve=405504
[  0% 22/10849] 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 )"
Jack server already installed in "/home/jack/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/jack/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
No Jack server running. Try 'jack-admin start-server'
No Jack server running. Try 'jack-admin start-server'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (07:11 (mm:ss)) ####

 

通过查看文件 $HOME/.jack-server/logs/jack-server-0-0.log

1、判断端口是否被占用可以执行如下命令:
netstat -apn | grep 8076

netstat -apn | grep 8072

netstat -apn | grep 8073

2、jack-server端口配置出现冲突,需修改这3个文件的端口,修改为没有被使用的端口,我这里8072,8073没有被使用

 changed port     
    SERVER_PORT_SERVICE   8076->8072
    SERVER_PORT_ADMIN     8077->8073

jack是用户名,我是用jack用户登录ubuntu的

prebuild/sdk/tools/jack-admin脚本
/home/jack/.jack-settings  脚本            此文件的权限也需要是”rw”,如果不是的话执行  chmod 600 jack-settings
/home/jack/.jack-server/config.properties  此文件的权限也需要是”rw”,如果不是的话执行  chmod 600 config.properties

3、虽然在fullbuild过程中会自动启动jack server,还是建议先启动jack server再编译源码,这样不至于出现编译了好久突然报错,这样会浪费时间。
#启动Jack server
jack-admin start-server
 
#查看Jack server状态
jack-admin server-stat
 
#查看当前服务器有那些Jack server是运行中的

$ jack-admin list-server
jack      73761 java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8192M -cp /home/jack/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
jack     124775 java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8192M -cp /home/jack/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
4、编译即可 make -j8  我的电脑CPU是8核,所以-j8

参考:

https://blog.csdn.net/m0_37302832/article/details/79278478
https://blog.csdn.net/qq_27061049/article/details/70156200
https://blog.csdn.net/zengxx1989/article/details/75554854
https://blog.csdn.net/u010684585/article/details/76263317
https://blog.csdn.net/LoongEmbedded/article/details/70243355
https://blog.csdn.net/tangzhihai0421/article/details/53487156
https://bbs.csdn.net/topics/392023688

你可能感兴趣的:(Android,linux,Android7.1.2)