线程“ queue-resource-processor_4”中的异常

时间:2018-07-27 05:50:55

标签: android gradle android-studio-3.0

突然我在一周前遇到了android studio的问题,它可以正常工作,但是现在当我运行应用程序时,它会生成“ Queued-resource-processor-4”异常 我已经尝试过答案是

  1. 尝试禁用防病毒软件-我没有使用防病毒软件

  2. 添加环境变量-失败

  3. android.enableAapt2 = false(在gradle.properties中)-无法正常工作,并显示警告,提示已弃用 这是日志

  4. 降级Gradle插件-仍然没有成功

这是日志

Executing tasks: [:app:generateDebugSources]

Parallel execution with configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE

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)

出现错误之前,它将打开多个aapt.exe控制台窗口,如下图所示 enter image description here

更新:

build.gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '28.0.1'
defaultConfig {
    applicationId "com.blackhat.something"
    minSdkVersion 21
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    jackOptions {
        enabled true
    }

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}


dependencies {
 compile fileTree(include: ['*.jar'], dir: 'libs')

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.reginald:patternlock:1.1.0'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'org.jetbrains:annotations:15.0'
compile 'com.devs:acr:1.0.1'
}

有人请帮助我........

1 个答案:

答案 0 :(得分:1)

我有同样的问题。我通过更新gradle解决了它,在您的情况下,它不起作用,因为您还必须更改gradle的分发路径。试试这个:

Dockerfile

并在gradle.properties中添加以下内容:

classpath 'com.android.tools.build:gradle:3.2.0-alpha17'

希望这行得通....