Java – gradle build error (Android studio 2.2.2)
•
Java
I installed Android studio 2.2 with the necessary packages on Debian Jessie 2 and check for updates
When the gradle build started, I made two errors:
I look for answers on this forum. I try to solve this error by editing the PNG file in the / RES / drawable folder I used the pinta image editor and saved the file as launcher png
I also checked gradle Build file and ensure that the SDK build tool version displayed in it is a continuous version (25.0.0)
Module gradle file:
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') }
Project level gradle file
// 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 console
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
Please help me fix this error
thank you
Solution
Change the buildtoolversion in the gradle file
android { compileSdkVersion 25 buildToolsVersion "25.0.0" // change here with your installed buildtool version defaultConfig { applicationId "com.project.project" minSdkVersion 10 targetSdkVersion 25 }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码