Android7.0 编译问题


AndroidN编译需要用到java 1.8以上版本.

第一次出错:

1 warning generated.

[ 31% 10040/31772] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
GC overhead limit exceeded
Try increasing heap size with java option '-Xmx'
Warning: This may have produced partial or corrupted output.

ninja: build stopped: subcommand failed.

第二次出错:

[  0% 42/36388] RenderScript: Gallery2 <= packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/convolve3x3.rs packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/grad.rs      packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/grey.rs packages/apps/Gallery2/src/com/android/gallery3d/filtershow/filters/saturation.rs packages/apps/Gallery2/src/com/android/ga     llery3d/filtershow/filters/vignette.rs
2036 [  0% 43/36388] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex
2037 FAILED: /bin/bash out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
2038 java.lang.AssertionError: java.util.zip.ZipException: duplicate entry: jayce/android/printservice/PrintService$1.jayce
2039     at com.android.sched.vfs.WriteZipFS$ZipEntryOutputStream.writeEntryIfNeeded(WriteZipFS.java:350)
2040     at com.android.sched.vfs.WriteZipFS$ZipEntryOutputStream.close(WriteZipFS.java:320)
...............

解决办法:

 1.在文件/prebuilts/sdk/tools/jack-admin中修正-Xmx参数(-Xmx:4096m).

  JACK_SERVER_VM_ARGUMENTS="${JACK_SERVER_VM_ARGUMENTS:=-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx:4096m}"
2.jack-admin中的start-server语句,直接在里面增加:

在start_server的case 下,

start-server)

..............

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



你可能感兴趣的:(Android7.0 编译问题)