一、编译报错:
[ 97% 304/311] 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/fuwei/.jack-server"
Launching Jack server java -XX:
MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX: +TieredCompilation -cp
/home/fuwei/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
SSL error when connecting to the Jack server. Try 'jack-diagnose'
SSL error when connecting to the Jack server. Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (07:51 (mm:ss)) ####
[Done]
Making Project Done at [Fri Dec 15 10:49:28 2023]
Making Project Done at Fri Dec 15 10:49:28 2023 [FAILED]
============================================================================
以上就是报错的全部内容,在网上找了很久,各有各的问题,但是和我一样的问题也不少,把报错信息全部显示出来。
问题关键:
Ubuntu 安装openjdk1.8后,必须干掉 TLSv1, TLSv1.1 我看到这个就想起来了。恼火啊。
二、解决方案:
文件位置【/etc/java-8-openjdk/security/java.security】
【706 行 jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves】
【删除 TLSv1, TLSv1.1】
然后运行
【 cd /prebuilts/sdk/tools/】
【 ./jack-admin kill-server】【 ./jack-admin start-server 】
重启电脑,然后就可以编译了。【重启前记得做笔记哦!】
详细情况可见:【https://stackoverflow.com/questions/67363030/rebuild-android-code-with-error-ssl-error-when-connecting-to-the-jack-server-t#】
另外我试过的方法:文章来源:https://www.toymoban.com/news/detail-767366.html
方法一:
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server
不奏效
方法二:
在根目录下【gedit ./.jack-server/config.properties】
$HOME/.jack-server/config.properties Code:
jack.server.max-service=4
Try to make this value 2 or 1.
也不奏效
三、记录其他人掉过的坑
一.同时编译时报错
Communication error with Jack server (35), try 'jack-diagnose' or see Jack server log
SSL error when connecting to the Jack server. Try 'jack-diagnose'
SSL error when connecting to the Jack server. Try 'jack-diagnose'
解决方案:
(1)$HOME/.jack-settings
SERVER_PORT_SERVICE=8076
SERVER_PORT_ADMIN=8077
(2)$HOME/.jack-server/config.properties
jack.server.service.port=8076
jack.server.admin.port=8077
=======================================================================================
二.权限问题
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------
解决方案:
sudo chmod -R 0600 .jack-settings
sudo chmod -R 0600 .jack-server/config.properties
=======================================================================================
三.jack-admin缺少变量JACK_JAR
ERROR: Communication error with Jack server (52) make:
*** [out/target/common/obj/JAVA_LIBRARIES/libutil_intermediates/classes.jack] Error
解决方案:工程根目录内执行以下三句,再进行编译。
export JACK_JAR=./out/host/linux-x86/framework/jack.jar
./out/host/linux-x86/bin/jack-admin stop-server
./out/host/linux-x86/bin/jack-admin start-server
=======================================================================================
四.
communication error with Jack server (1)
* Protocol "https" not supported or disabled in libcurl
* Closing connection -1
原来是curl不支持https。
解决方案:
重装curl【在curl安装源目录下,输入:./configure –prefix -ssl】【重新安装jack-server】
四、分析过程:
【cd prebuilts/sdk/tools】
./jack-admin dump-report
生成:
Creating report...
Dumping Jack server stacks...
Getting current user id...
Listing Jack server process...
Listing process using Jack server service port 8076...
Listing process using Jack server admin port 8077...
Collecting Jack client configuration...
Listing Jack server installation dir...
Collecting curl version...
Collecting curl connection info...
Collecting Jack server stats...
Zipping Jack server installation dir except keys and certificates...
Jack server report saved in 'jack-report.23947.zip'. Consider reviewing content before publishing.
打开这个'jack-report.23947.zip'
看这个里面的report.23947.txt以及log里面的文件。
发现自己什么也没发现。
然后【chmod +764 jack-diagnose】
'/usr/bin/java' is too old, please update to 1.7 or newer
error: process ID list syntax error
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
Port 8077 is used by another process (pid=),
please ensure to free the port or change port configuration
in '/home/fuwei/.jack-settings' and '/home/fuwei/.jack-server/config.properties'
error: process ID list syntax error
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
Port 8076 is used by another process (pid=),
please ensure to free the port or change port configuration
in '/home/fuwei/.jack-settings' and '/home/fuwei/.jack-server/config.properties'
好的,找到类似的东西了。解决方案在上面。
五、Android 7.0 jack 相关配置:
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
六、参考资料
1.【https://stackoverflow.com/questions/67363030/rebuild-android-code-with-error-ssl-error-when-connecting-to-the-jack-server-t#】【英文资料】
2.【https://blog.csdn.net/codeslave1130/article/details/83988820】
3.【https://blog.csdn.net/m0_37910557/article/details/116701908】
4.【https://www.cnblogs.com/blogs-of-lxl/p/11589521.html】
5.【https://blog.csdn.net/qq_37858386/article/details/119599118】【这个可以先看看,写的很好】
6.【https://blog.csdn.net/m0_58241002/article/details/125912231】文章来源地址https://www.toymoban.com/news/detail-767366.html
到了这里,关于Android 7.0 源码编译报错:SSL error when connecting to the Jack server. Try ‘jack-diagnose‘的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!