当前位置: 首页 > 知识库问答 >
问题:

Gradle构建错误(Android Studio 2.2.2)

谢鸿飞
2023-03-14

我安装了Android Studio 2.2。2使用Debian Jessie上的必要软件包并检查更新

当gradle构建开始时,我有2个错误:

错误:java.lang.运行时间异常:CrunchingCruncherlauncher.png失败,请参阅日志错误:任务执行失败:应用程序:mergeDebugResources。

我在这个论坛上寻找答案,我试图通过编辑/res/drawable文件夹中的png文件来解决这个错误。我使用Pinta图像编辑器并将文件另存为启动器。巴布亚新几内亚

我还查了格雷德尔。构建文件,并确保其中显示的SDK构建工具版本持续到版本(25.0.0)

模块gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 10
    buildToolsVersion "25.0.0"

    defaultConfig {
        applicationId "com.project.project"
        minSdkVersion 10
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    compile files('libs/httpmime-4.0.jar')
}

项目级渐变文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

梯度控制台

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

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 1101934): /root/Android/Sdk/build-tools/25.0.0/aapt: 3: /root/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
AAPT err(Facade for 29345672): /root/Android/Sdk/build-tools/25.0.0/aapt: 3: /root/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

Thread(png-cruncher_5): Broken pipe
java.io.IOException: Broken pipe
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:326)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

Thread(png-cruncher_4): Broken pipe
java.io.IOException: Broken pipe
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:326)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)

Error: java.lang.RuntimeException: Crunching Cruncher launcher.png failed, see logs

AAPT err(Facade for 14139714): /root/Android/Sdk/build-tools/25.0.0/aapt: 3: /root/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

AAPT err(Facade for 3636584): /root/Android/Sdk/build-tools/25.0.0/aapt: 3: /root/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

Thread(png-cruncher_3): Stream closed
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)
Thread(png-cruncher_2): Stream closed
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)

:app:mergeDebugResources FAILED

AAPT err(Facade for 5293242): /root/Android/Sdk/build-tools/25.0.0/aapt: 3: /root/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
Thread(png-cruncher_1): Stream closed
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)

Process list not empty
Thread(png-cruncher_3): queue not cleaned

while shutting downpng-cruncher_3
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.shutdown(QueuedCruncher.java:161)
    at com.android.builder.tasks.WorkQueue.shutdown(WorkQueue.java:169)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:309)
    at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.java:430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Thread(png-cruncher_4): queue not cleaned

while shutting downpng-cruncher_4
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.shutdown(QueuedCruncher.java:161)
    at com.android.builder.tasks.WorkQueue.shutdown(WorkQueue.java:169)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:309)
    at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.java:430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Thread(png-cruncher_1): queue not cleaned

while shutting downpng-cruncher_1
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.shutdown(QueuedCruncher.java:161)
    at com.android.builder.tasks.WorkQueue.shutdown(WorkQueue.java:169)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:309)
    at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.java:430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Thread(png-cruncher_2): queue not cleaned

while shutting downpng-cruncher_2
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.shutdown(QueuedCruncher.java:161)
    at com.android.builder.tasks.WorkQueue.shutdown(WorkQueue.java:169)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:309)
    at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.java:430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Thread(png-cruncher_5): queue not cleaned

while shutting downpng-cruncher_5
java.io.IOException: Stream closed
    at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    at java.io.OutputStream.write(OutputStream.java:116)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.shutdown(QueuedCruncher.java:161)
    at com.android.builder.tasks.WorkQueue.shutdown(WorkQueue.java:169)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:309)
    at com.android.builder.internal.aapt.v1.AaptV1.lambda$compile$0(AaptV1.java:430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.lang.RuntimeException: Crunching Cruncher launcher.png failed, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.213 secs

请帮助我修复此错误

谢啦

共有3个答案

山凌
2023-03-14

替换构建。格雷德尔说:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
    applicationId "com.project.project"
    minSdkVersion 10
    targetSdkVersion 25
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}

dependencies {
compile 'com.android.support:support-v4:25.0.0'
compile files('libs/httpmime-4.0.jar')
}
公良浩邈
2023-03-14

我在Debian 32位中修复了此错误:

上传Android SDK Build Tools版本19.1

项目结构-

之后,无错误地构建项目

厍和颂
2023-03-14

在gradle文件中更改构建工具版本

    android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0" // change here with your installed buildtool version

    defaultConfig {
    applicationId "com.project.project"
    minSdkVersion 10
    targetSdkVersion 25
    }
 类似资料:
  • 我已经在Ubuntu 16.04 x64上安装了Android Studio。启动新项目时,我在

  • 问题是如何启用堆栈跟踪,以便找到错误的根源。事实上,我真的不知道是什么引起的。

  • 我的代码一直在正确编译,但现在我突然遇到以下错误: 错误:配置项目: app时出现问题。 无法解析配置“:app:classpath”的所有依赖项。无法解析com。粗制滥造。工具。gradle:crashlytics gradle:1。所需者:EnergyLens:app:unspecified未能列出com的版本。粗制滥造。工具。格拉德:粗鲁的格拉德。无法从加载Maven元数据http://do

  • gradle构建错误: Build file 'D:\movierecommend\build.gradle' line: 33 A problem occurred evaluating root project 'movie-recommend'. org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact.<init>(L

  • 我在android studio上创建新项目时发现了这个错误,我不知道我的设置会发生什么变化。任何人都可以解释如何在android studio上解决此错误? 我删除了. gradle在我的用户主文件夹,这是错误仍然发生。我使用OSX 10.10.3和Android Studio1.1.0

  • 我的Windows 10笔记本电脑上安装了最新的Android Studio IDE,在我的Windows操作系统进行了巨大的自动更新之前,它一直运行良好。 现在,当我启动我的Android Studio IDE时,我得到了以下错误,它不能构建。 Gradle同步失败:读取超时查看IDE日志了解更多详细信息(帮助|显示日志)(3m34s 195ms) 我需要帮助。