为什么 gradle 构建无法完成?

为什么 gradle 构建无法完成?

我已将所有内容更新至最新版本。我检查了 JDK - 它有效,我安装了以下软件包:lib32z1 lib32ncurses5-dev lib32stdc++6 libncurses5:i386 libstdc++6:i386 zlib1g:i386。当我尝试运行我的应用程序时,gradile 的构建从未停止。
日志:

2:09:20 AM Gradle sync started
2:10:22 AM Gradle sync completed
2:10:27 AM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]

Gradile 控制台:

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2320Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2320Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
AAPT err(Facade for 1767133010): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1969709623): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1006614347): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1785369662): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1881902230): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 996071813): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 2137684494): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 202834109): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1759893362): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1712078357): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 13911109): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1936794562): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 273220858): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1981849064): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1056584022): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Exception in thread "png-cruncher_1" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_4" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_5" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_3" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
AAPT err(Facade for 995994054): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 564585174): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 955623687): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 19057521): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
AAPT err(Facade for 1612347429): /home/user/Android/Sdk/build-tools/23.0.2/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Exception in thread "png-cruncher_6" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_8" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_9" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_7" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_10" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_11" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_12" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_14" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_13" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_15" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_17" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_16" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_20" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_19" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_18" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/user/Android/Sdk/build-tools/23.0.2/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
    at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)

在此处输入图片描述

答案1

只需尝试lib32z1通过以下方式安装:

apt-get install lib32z1

答案2

这对我有用:

  • 转到设置->“构建、执行、部署”->“Gradle”。

  • 在项目级设置下选择“使用默认 gradle 包装器”。

相关内容