Fixing the issue: Communication error with Jack server (35) when building AOSP
I met an issue
Communication error with Jack server (35) when built the AOSP yesterday. I can build the AOSP successfully before this issue popped up. I spent hours figuring out why and solved the problem.
My build environment of the AOSP is
- Ubuntu 16.04 LTS server;
- Android AOSP 8.0;
- OpenJDK 8;
It works well until the below issue occurred yesterday. I remembered that I didn’t do anything unusual before that.
First, I tried to debug it by following the information in the logs. I ran the
jack-diagnose command and it returned the below message.
The log indicated the port has been used by another process, so I changed the port to another one by modifying the port number in the
However, it didn’t work. The issue was still existing.
Then I tried to restart the jack server by commands:
The issue was still there!
There are some articles on the internet talking about this error, they pointed that the issue was caused by the multiple users doing the build process simultaneously, which is not supported by jack and will bring the issue. The solution is to change the port number to another one to keep jack working. But I don't think it is my case. And the result confirmed my idea.
OK! I kept investigating to get more information.
I checked the log in the file -
~/.jack-server/log/xxxx-0-0.log. It has nothing about the error.
I ran command
./prebuilts/sdk/tools/jack-admin dump-report and this time I got some useful information in the error report.
Looks like it is related to the TLS connection, so I ran more commands to check.
It verified that the issue is because of the TLS connection failure.
Follow this clue, I searched Google to check if anyone has met the same issue with me. I finally found the post in stackoverflow that discussed this issue and provided the solution.
The reason for this issue is that I upgraded my OpenJDK to 8u292, but OpenJDK disabled the support for TLS 1.0 and 1.1, starting in
8u291. They think TLS 1.0/1.1 are old, insecure, and deprecated. Unfortunately, I was using TLS1.1 on my build system, therefore, the connection was broken for this reason.
I have two ways to solve this problem.
- I can turn on the support of TLS1.0/1.1 manually by removing the
TLSv1, TLSv1.1declaring in
jdk.tls.disabledAlgorithmsconfiguration in file
- Switch to use TLS1.2 for the build system.
Solution 1 is relatively quick so I tried this way.
I enabled the support to TLS1.0/1.1, restart the jack server, and ran the build again.
It worked this time!
If you’re in trouble with this issue like me, hope my experience and study can help you a little bit!