gpt4 book ai didi

java - Gradle 构建错误(Android Studio 2.2.2)

转载 作者:太空宇宙 更新时间:2023-11-03 12:15:14 26 4
gpt4 key购买 nike

我在 Debian Jessie 上安装带有必要软件包的 Android Studio 2.2.2 并检查更新

gradle 构建开始时出现 2 个错误:

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

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

我还检查了 gradle.build 文件并确保那里显示的 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')
}

项目级gradle文件

// 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()
}
}

Gradle 控制台

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

请帮我解决这个错误

谢谢

最佳答案

在你的 gradle 文件中更改 buildtoolversion

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

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

关于java - Gradle 构建错误(Android Studio 2.2.2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40544295/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com