Jack-server failing on AOSP master

32,849 views
Skip to first unread message

Kim Schulz

unread,
Dec 4, 2015, 1:45:02 PM12/4/15
to Android Building
I am trying to build AOSP master, but the new JACK-server is giving me a hard time. 
During build I hit this:
[  0% 4/21058] /bin/bash -c "(true) && (out/host/linux-x86/bin/jack-admin install-server out/host/linux-x86/framework/jack-launcher.jar out/host/linux-x86/framework/jack-server.jar  2>&1 || (exit 0)) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" out/host/linux-x86/bin/jack-admin start-server 2>&1 || exit 0) && (out/host/linux-x86/bin/jack-admin update server out/host/linux-x86/framework/jack-server.jar 4.1.ALPHA 2>&1 || exit 0) && (out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack--1.1.PRE_ALPHA.jar -1.1.PRE_ALPHA || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack--1.2.PRE_ALPHA.jar -1.2.PRE_ALPHA || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.24.RELEASE.jar 2.24.RELEASE || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.7.ALPHA.jar 3.7.ALPHA || exit 47) && (mkdir -p out/host/linux-x86/obj/EXECUTABLES/jack_intermediates/) && (out/host/linux-x86/bin/acp -fp prebuilts/sdk/tools/jack out/host/linux-x86/obj/EXECUTABLES/jack_intermediates/jack)"
FAILED: /bin/bash -c "(true) && (out/host/linux-x86/bin/jack-admin install-server out/host/linux-x86/framework/jack-launcher.jar out/host/linux-x86/framework/jack-server.jar  2>&1 || (exit 0)) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" out/host/linux-x86/bin/jack-admin start-server 2>&1 || exit 0) && (out/host/linux-x86/bin/jack-admin update server out/host/linux-x86/framework/jack-server.jar 4.1.ALPHA 2>&1 || exit 0) && (out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack--1.1.PRE_ALPHA.jar -1.1.PRE_ALPHA || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack--1.2.PRE_ALPHA.jar -1.2.PRE_ALPHA || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.24.RELEASE.jar 2.24.RELEASE || exit 47; out/host/linux-x86/bin/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.7.ALPHA.jar 3.7.ALPHA || exit 47) && (mkdir -p out/host/linux-x86/obj/EXECUTABLES/jack_intermediates/) && (out/host/linux-x86/bin/acp -fp prebuilts/sdk/tools/jack out/host/linux-x86/obj/EXECUTABLES/jack_intermediates/jack)"
Jack server already installed in "/home/kschulz/.jack-server"
Communication error with Jack server (58), try other ports or see Jack server log
Failed to contact Jack server: Problem reading /home/kschulz/.jack-server/client.pem
Failed to contact Jack server: Problem reading /home/kschulz/.jack-server/client.pem


I have searched to try to find a solution for this but no one else seem to have discussed this problem yet. 

I have tested on Ubuntu 13, 14 and 15 without luck (all of which worked fine before moving to Jack). 


anyone that has an idea as to how I get by this problem ? 

thanks 

quake73

unread,
Dec 16, 2015, 10:36:46 AM12/16/15
to Android Building
Kill your existing jack servers and delete your .jack-server folder (it will be rebuilt automatically). Afterwards, I expect you to have other problems.  

I tried a lot of tricks, in the end I think this worked for me:

sudo aptitude install libcurl4-openssl-dev nss-updatedb 

I'm not sure which of the 2 packages was necessary but the build now runs.

My theory is, the building with jack uses the 'curl' program which for some reason cannot connect through ssl to the jack server because of some certificate incompatibility, NSS/OpenSSL, something like that.

Kim Schulz

unread,
Dec 18, 2015, 10:57:03 AM12/18/15
to Android Building
Did have a other problems afterwards but not SSL related anymore. Now it runs out of resources (heap) and I need to start it with _JAVA_OPTIONS="-Xmx6G" jack-admin start-server in order to get it to compile all of android.
I can get it compiled now but not exactly stable build. Jack server still wants to restart itself (or simply dies) and cannot connect afterwards. At some point it times out and I can restart the build and it will continue from where it died. 



kim 

quake73

unread,
Dec 18, 2015, 12:06:27 PM12/18/15
to Android Building
yes, i'm getting those too, found the Xmx option in build/core/config.mk, did the same as you, tried different larger values (added the Xms option, too) but still getting all sorts of errors. Sometines it explicitly complains about SSL, sometimes the build process gets stuck (with the java process taking 80-90% cpu). Also, jack server doesnt start if you only delete the '.jack-server' folder (found out that you must also clear the 'out' folder in that case, otherwise the folder doesnt get rebuilt). Frustrating.

Blaze Ristov

unread,
Dec 24, 2015, 5:48:06 AM12/24/15
to android-...@googlegroups.com
I think I finally found a neat and elegant solution - just turn off the damn jack server in build/core/configure_local_jack.mk by changing the line:

LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
into:
LOCAL_JACK_ENABLED := #$(strip $(LOCAL_JACK_ENABLED))

and my build of 6.0.1_r3 succeeded

On Fri, Dec 18, 2015 at 5:46 PM, quake73 <blazer...@gmail.com> wrote:
yes, i'm getting those too, found the Xmx option in build/core/config.mk, did the same as you, tried different larger values (added the Xms option, too) but still getting all sorts of errors. Sometines it explicitly complains about SSL, sometimes the build process gets stuck (with the java process taking 80-90% cpu). Also, jack server doesnt start if you only delete the '.jack-server' folder (found out that you must also clear the 'out' folder in that case, otherwise the folder doesnt get rebuilt). Frustrating.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Android Building" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-building/8SQ0-4zZDo8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

de...@codeplay.com

unread,
Feb 17, 2016, 10:13:38 AM2/17/16
to Android Building
unfortunately, the hack above might cause a different error when building a more recent aosp:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
    at com.android.dx.command.dexer.Main.processClass(Main.java:752)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Caused by: com.android.dx.cf.iface.ParseException: unsupported class file version 52.0
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:485)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:750)
    ... 12 more

While when deleting the folder ~/.jack-server the current build system does not seem able to recreate the certificates client.pem and server.pem. I've solved by building an old version of the aosp (Dec'15) which correctly creates the certificates, and then rebuilding with the current version of the aosp..

tamil

unread,
Jun 2, 2016, 3:06:19 PM6/2/16
to Android Building
Hi,

           When i tried to build the latest AOSP on ubuntu 14.04. i am getting this following error

[ 31% 14186/45738] Ensure Jack server is installed and started
Jack server already installed in "/root/.jack-server"
Server is already running
[ 31% 14206/45738] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/with-local/classes.dex.rsp
Picked up _JAVA_OPTIONS: -Xmx4096m
Picked up _JAVA_OPTIONS: -Xmx4096m
Communication error with Jack server (28). Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1

Please help...

Валерий Тихомиров

unread,
Aug 25, 2016, 9:51:49 AM8/25/16
to Android Building
Hi, try this:

# Use 7GB RAM for Jack Server -1GB from 8GB
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx7000m"
# Killing...
out/host/linux-x86/bin/jack-admin kill-server
# Starting...
out/host/linux-x86/bin/jack-admin start-server

Avtar Singh

unread,
Aug 26, 2016, 11:21:29 AM8/26/16
to android-...@googlegroups.com
Kim,

It is most likey to do with the memory. Try bumping RAM as mentioned by mexanicteam below. I do remember running into this problem, and I recall bumping up the RAM but I also recall reducing the number of simultaneous threads in jack-server. I can't recall the exact fix. However, what I had done was go through the readme-docs provided in the jack-server folder and play around with the settings they had mentioned.

- Avtar

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

forever...@gmail.com

unread,
Aug 29, 2016, 9:57:26 AM8/29/16
to Android Building
https://android-review.googlesource.com/#/c/233481/

I think  this way can help you 

在 2015年12月5日星期六 UTC+8上午2:45:02,Kim Schulz写道:

Neo Yang

unread,
Sep 19, 2016, 10:11:11 AM9/19/16
to Android Building
Hi Валерий Тихомиров,

It works for me.

Many thanks.

在 2016年8月25日星期四 UTC+8下午9:51:49,Валерий Тихомиров写道:

Weave Bytes

unread,
Apr 30, 2017, 9:22:51 PM4/30/17
to Android Building
To Kim & Avtar,

We can do 2 things.

1. edit $HOME/.jack-server/config.properties

and set jack.server.max-service=1

2. export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx2G"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server

I hope this helps.

Thanks,
N. Singh
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Changshu Li

unread,
Jun 1, 2017, 10:01:27 AM6/1/17
to Android Building
This method works. Thank you.

Maxsim

unread,
Mar 21, 2018, 10:04:32 AM3/21/18
to Android Building
Hello, Could somebody help me with next problem:

console log:

ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
[  0% 250/83955] Ensuring Jack server is installed and started
FAILED: setup-jack-server
/bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.11.ALPHA.jar  2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Xmx2g -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.11.ALPHA.jar 4.11.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.32.CANDIDATE.jar 4.32.CANDIDATE || exit 47 )"
Jack server already installed in "/home/m_timenko/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/m_timenko/.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'
[  0% 253/83955] target  C++: libv8src_32 <= external/v8/src/map-updater.cc

ninja: build stopped: subcommand failed.
15:10:34 ninja failed with: exit status 1

#### failed to build some targets (05:21 (mm:ss)) ####

log from file:

15:05:30.422: INFO: com.android.jack.server.JackHttpServer: Loading config of jack server version: 1.3-a11 '1.3' (402300 704631c4e9bbfb4e8b052365140f79974b9f4cf4 by android-...@google.com)
15:05:30.456: INFO: com.android.jack.server.JackHttpServer: Starting service connection server on /127.0.0.1:8076
15:05:30.460: INFO: com.android.jack.server.JackHttpServer: Starting admin connection on /127.0.0.1:8077
15:05:30.471: SEVERE: com.android.jack.launcher.ServerLauncher: Server 1 Exception
com.android.jack.server.api.v01.ServerException: Failed to setup ssl context
    at com.android.jack.server.JackHttpServer.setupSsl(JackHttpServer.java:1424)
    at com.android.jack.server.JackHttpServer.start(JackHttpServer.java:801)
    at com.android.jack.server.JackServerImpl.run(JackServerImpl.java:67)
    at com.android.jack.launcher.ServerLauncher$3.run(ServerLauncher.java:392)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Invalid keystore format
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:650)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at com.android.jack.server.JackHttpServer.setupSsl(JackHttpServer.java:1403)
    ... 4 more

Donato Azevedo

unread,
Apr 16, 2018, 1:03:06 PM4/16/18
to Android Building


On Wednesday, March 21, 2018 at 11:04:32 AM UTC-3, Maxsim wrote:
Hello, Could somebody help me with next problem:

console log:

ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
[  0% 250/83955] Ensuring Jack server is installed and started
FAILED: setup-jack-server
/bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.11.ALPHA.jar  2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Xmx2g -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.11.ALPHA.jar 4.11.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.32.CANDIDATE.jar 4.32.CANDIDATE || exit 47 )"
Jack server already installed in "/home/m_timenko/.jack-server"
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/m_timenko/.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'
[  0% 253/83955] target  C++: libv8src_32 <= external/v8/src/map-updater.cc
ninja: build stopped: subcommand failed.
15:10:34 ninja failed with: exit status 1

I'm having a similar issue. It seems jack is not *really* meant for multi-user builds -- and that is my case (I have a build server that multiple people use to build a shared lib that uses ndk). You need to check if the user you are running your build as is m_timenko. Any other user will not be able to access the jack-server installed under /home/m_timenko/.jack-server unless you properly configure it. I don't know how to configure it for multiple users, but there is a hint here: https://source.android.com/setup/build/jack that says:

Jack limitations
  • By default, the Jack server is mono-user and can be used by only one user on a computer. To support additional users, select different port numbers for each user and adjust SERVER_NB_COMPILE accordingly. You can also disable the Jack server by setting SERVER=false in $HOME/.jack.
If anyone has an example of how to do this, I would certainly appreciate the help.


Reply all
Reply to author
Forward
0 new messages