报错原因

jack不支持多用户同时编译,所以经常出现jack server报错的现象

解决方法

编辑 $home/.jack,$home/.jack-settings 和 $home/.jack-server/config.properties,修改SERVER_PORT_SERVICE和SERVER_PORT_ADMIN的端口号,然后保存。

如果权限不对可以执行下面的命令修改权限:

chmod 600 .jack

chmod 600 .jack-settings

chmod 700 .jack-server

查看jack server是否启动

cd prebuilts/sdk/tools ./jack-admin start-server/stop-server

jack-admin server-log命令来查找log所在目录

3.在Android 7.0的工程中进行编译之前,运行如下命令,进行交互

bule@sky:~/workspace/jianwen.fu/jianwen.fu/V65_An7/prebuilts/sdk/tools$

  jack-admin start-server

  jack-admin kill-server

  jack-admin list-server

  jack-admin uninstall-server

  mm -j32 showcommands &> mm.out

  jack-admin install-server jack-launcher.jar  jack-server-4.8.ALPHA.jar

  jack-admin dump-report

  jack-admin dump-re

问题:

No Jack server running. Try 'jack-admin start-server'

解决方案:

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

com.android.jack.server.api.v01.ServerException: './config.properties' musthave permission rw------- but have rwx------

Caused by: java.io.IOException: './config.properties' must have permissionrw------- but have rwx------

... 2 more

发现是配置文件的权限不对造成的,把文件$HOME/.jack-server/config.properties的权限由rwx改为rw即可解决问题。