您好,登錄后才能下訂單哦!
如下所示:
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
Out of memory error (version 1.2-a26 'Carnac' (291201 fcd657165d2fd6dcf1bf4c3002c9c8f75383e815 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
在文件/prebuilts/sdk/tools/jack-admin中修正-Xmx參數。
1、修改變量JACK_SERVER_VM_ARGUMENTS,添加參數 -Xmx2048M
JACK_SERVER_VM_ARGUMENTS="${JACK_SERVER_VM_ARGUMENTS:=-Dfile.encoding=UTF-8 -XX:+TieredCompilation -mx2048M}"
2、進一步修正重啟參數(該步驟可以省略)
找到jack-admin中的start-server語句,直接在里面增加:
start-server) isServerRunning RUNNING=$? if [ "$RUNNING" = 0 ]; then echo "Server is already running" else echo "before to start-server,JACK_SERVER_VM_ARGUMENTS=" $JACK_SERVER_VM_ARGUMENTS JACK_SERVER_COMMAND="java -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS-Xmx2048M -cp $LAUNCHER_JAR $LAUNCHER_NAME" echo "Launching Jack server" $JACK_SERVER_COMMAND (
補充知識:編譯android 7.0 出現Try increasing heap size with java option '-Xmx'錯誤解決方案
出現這個錯誤是由于電腦內存不足,在命令行分別執行以下三條語句,然后繼續編譯
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
以上這篇解決Android 源碼編譯錯誤的問題就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持億速云。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。