2016-11-11 62 views
3

我安裝Android 2.2.2工作室與Debian的傑西必要的包裝,並檢查更新搖籃建立自己的錯誤(Android Studio中2.2.2)

我有2個錯誤的gradle時開始建設:

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

我一直在尋找在這個論壇的答案,我試圖在/ RES編輯PNG文件來解決這個錯誤/繪製folder.I使用平塔圖像編輯器和文件保存爲launcher.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() 
    } 
} 

搖籃控制檯

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 

請幫我解決這個錯誤

感謝

+0

看看這個答案的http:/ /stackoverflow.com/questions/30111443/android-studio-fails-to-build-new-project-timed-out-while-wating-for-slave-aapt –

+0

看看我的答案在這裏,可能有所幫助:https:// stackoverflow.com/a/44892542/3412127 – larrytech

回答

0

這種替換的build.gradle:

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') 
} 
+0

不幸的是,不工作我,再次出現2次錯誤 – 1cent

2

我解決這個錯誤,在Debian的32位:

載Android SDK構建工具版本19.1

項目結構 - >屬性 - >生成工具版本19.1

後則項目建設沒有錯誤

4

變化buildtoolversion在gradle這個文件

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

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