Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error compiling Android system

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

The following error occurred during Android7.1 compilation:

Starting build with ninjaninja: Entering directory `.'[0% 8 Djava.io.tmpdir=/tmp 30301] Ensure Jack server is installed and startedJack server already installed in "/ home/guochongxin/.jack-server" Launching Jack server java-XX:MaxJavaStackTraceDepth=-1-Djava.io.tmpdir=/tmp-Dfile.encoding=UTF-8-XX:+TieredCompilation-cp / home/guochongxin/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher [0% 10ax 30301] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/libprotobuf-java -micro_intermediates/classes.jack [0% 12 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com 301] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dexFAILED: / bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rspOut of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)). GC overhead limit exceeded.Try increasing heap size with java option'-Xmx' .warning: This may have produced partial or corrupted output. [0% 12Accord 30301] Compiling SDK Stubs with Jack: out/target/comm...AVA_LIBRARIES/android_stubs_current_intermediates/classes.jackninja: build stopped: subcommand failed.make: * * [ninja_wrapper] Error 1

From the above error prompt, you can see the following sentence:

Try increasing heap size with java option'- Xmx'.

According to the prompt statement found above, we modify the prebuilts/sdk/tools/jack-admin file as follows: 1. Find the following statement:

JACK_SERVER_COMMAND= "java-XX:MaxJavaStackTraceDepth=-1-Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS-cp $LAUNCHER_JAR $LAUNCHER_NAME"

two。 Modify the above statement to:

JACK_SERVER_COMMAND= "java-XX:MaxJavaStackTraceDepth=-1-Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS-Xmx4096m-cp $LAUNCHER_JAR $LAUNCHER_NAME"

The-Xmx4096m parameter is mainly added, and then restart the jack-admin service by executing the following command under the source directory:

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

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

After restarting the jack-admin service, re-execute the compile command at this time to compile and pass.

2.android build Communication error with Jack server (52)

Solution:

Restart jack using the command

Jack-admin stop-server

Jack-admin start-server

3. If jack-admin stop-server or jack-admin start-server fails

1), by modifying the configuration file ~ / .jack-settings, which is a hidden file and sets a different port number:

# Server settings

SERVER_HOST=127.0.0.1

SERVER_PORT_SERVICE=8076

SERVER_PORT_ADMIN=8077

# Internal, do not touch

SETTING_VERSION=4

Through the experiment, it is found that it has no effect to modify the port number in the configuration file $HOME/.jack-settings alone, and jack server always fails to start, indicating that the port is occupied:

Com.android.jack.server.api.v01.ServerException: Problem while opening service port

At com.android.jack.server.JackHttpServer.start (JackHttpServer.java:611)

At com.android.jack.server.JackServerImpl.run (JackServerImpl.java:62)

At com.android.jack.launcher.ServerLauncher$3.run (ServerLauncher.java:391)

At java.lang.Thread.run (Thread.java:745)

Caused by: java.net.BindException: Address already in use

At sun.nio.ch.Net.bind0 (Native Method)

At sun.nio.ch.Net.bind (Net.java:433)

At sun.nio.ch.Net.bind (Net.java:425)

At sun.nio.ch.ServerSocketChannelImpl.bind (ServerSocketChannelImpl.java:223)

At sun.nio.ch.ServerSocketAdaptor.bind (ServerSocketAdaptor.java:74)

At com.android.jack.server.ServerParameters.openSocket (ServerParameters.java:88)

At com.android.jack.server.ServerParameters.getServiceSocket (ServerParameters.java:67)

At com.android.jack.server.JackHttpServer.start (JackHttpServer.java:605)

2) you need to modify the port number in ~ / .jack-server/config.properties at the same time in order to be effective. You can start another jack server when another user starts jack server. In this way, multiple users can compile at the same time, and personal testing is effective:

# Tue Sep 13 17:44:41 CST 2016

Jack.server.max-jars-size=104857600

Jack.server.max-service=4

Jack.server.service.port=8076

Jack.server.max-service.by-mem=1\ = 2147483648\: 2\ = 3221225472: 3\ = 4294967296

Jack.server.admin.port=8077

Jack.server.config.version=2

Jack.server.time-out=7200 (modify the two red lines above, for example, 8086, 8087, etc.)

To sum up, the solution is:

Modify the port numbers in both $HOME/.jack-settings and $HOME/.jack-server/config.properties (for example, change to 8086 Universe 8087) to support simultaneous compilation by multiple users.

Note: some may not have a config.properties file, so you need to create a new config.properties file.

Then restart jack using the command

Jack-admin stop-server

Jack-admin start-server

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report