Sometimes, Jack just doesn’t want to play. Here is the error I got while trying to compile AOSP 7.0 for the Samsung SGH-M919, T-Mobile S4:
[ 1% 73/5641] Ensure Jack server is installed and started
Jack server already installed in “/home/alaskalinuxuser/.jack-server”
Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /home/alaskalinuxuser/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
[ 1% 74/5641] Building with Jack: out…k_intermediates/with-local/classes.dex
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Communication error with Jack server (52). Try ‘jack-diagnose’
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
And here is how I solved it:
$ export JACK_SERVER_VM_ARGUMENTS=”-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g”
$ ./prebuilts/sdk/tools/jack-admin kill-server
$ ./prebuilts/sdk/tools/jack-admin start-server
Essentially, Jack has an issue with regards to memory. What I have done here is give it more heap size to buffer the work that it is doing. I’ve done this by passing an argument to Jack through an environment variable. This variable will go away as soon as I close the terminal I am working in. I then stop and restart the Jack server.
This trick also works well if Jack tells you that you don’t have enough memory to compile something. You may get an error like this:
Try increasing heap size with ‘-Xmx<size>’
You can set the heap size to anything you want, but 4 GB worked pretty well for me.
Linux – keep it simple.
5 Replies to “Compiling: Problems with Jack”
bash: export: `-XX:+TieredCompilation’: not a valid identifier
bash: export: `-Xmx4g”’: not a valid identifier
The version of jack you are using is probably 1.3, while this was written using version 1.1. Check the documentation for Jack servers on Android builds website.
Here’s the link:
Hope that helps!
And here is an article that I wrote about Jack 1.3: https://thealaskalinuxuser.wordpress.com/2016/10/19/when-jack-turns-into-a-ninja/
Hi you have a user friendly site It was very easy to post fantastic