Executing tasks: [clean, :app:assembleDebug] ERROR - Android Studio 3

◇◆丶佛笑我妖孽 提交于 2020-02-24 11:51:09

问题


i am new of android studio. and i am making my first apps, in the previous version 2.3 i dont have problem or stuck when making apps. but when i upgrade to the new version 3.0 i got problem, and when i trying to rebuild apk. it stuck at Executing tasks: [clean, :app:assembleDebug] . same problem when i build apk, rebuild and clean up.

anyone can help fix this ?

I still cant fix this.

10 actionable tasks: 9 executed, 1 up-to-date

Executing tasks: [clean, :app:assembleDebug]

    Parallel execution with configuration on demand is an incubating feature.
    :clean
    :app:clean
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild
    :app:compileDebugAidl
    :app:compileDebugRenderscript
    :app:checkDebugManifest
    :app:generateDebugBuildConfig
    :app:prepareLintJar UP-TO-DATE
    :app:generateDebugResValues
    :app:generateDebugResources
    :app:mergeDebugResources
    Exception in thread "queued-resource-processor_4" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\kreuzell\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe 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.waitForReadyOrFail(AaptProcess.java:196)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:745)
    Exception in thread "queued-resource-processor_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\kreuzell\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe 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.waitForReadyOrFail(AaptProcess.java:196)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:745)
    Exception in thread "queued-resource-processor_1" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\kreuzell\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe 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.waitForReadyOrFail(AaptProcess.java:196)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:745)
    Exception in thread "queued-resource-processor_3" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\kreuzell\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe 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.waitForReadyOrFail(AaptProcess.java:196)
        at com.android.builder.internal.aapt.AaptQueueThreadContext.creation(AaptQueueThreadContext.java:56)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:213)
        at java.lang.Thread.run(Thread.java:745)

回答1:


Some Android Studio 3.0 users with similar build errors.

Your Error logs say:

Exception in thread "queued-resource-processor_4" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at C:\Users\kreuzell\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe can run successfully **(some anti-virus may block it)** or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds

It means, if your Internet connection is fine, your aapt process may be blocked by your antivirus or firewall. Try disabling your antivirus and build again.

If not works, you can try disabling AAPT2 like this:

Improved incremental resource processing using AAPT2, which is enabled by default. If you are experiencing issues while using AAPT2, you can disable it by setting android.enableAapt2=false in your gradle.properties file and restarting the Gradle daemon by running ./gradlew --stop from the command line.




回答2:


Put this in system variables:

SLAVE_AAPT_TIMEOUT = 30 

Then restart Windows, works beautifully for me.



来源:https://stackoverflow.com/questions/47118095/executing-tasks-clean-appassembledebug-error-android-studio-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!