AAPT错误无休止的gradle建设

时间:2016-06-18 12:08:02

标签: android android-gradle

我在Ubuntu 16.04 x64上安装了Android Studio。当开始新项目时,我在setContentView(R.layout.activity_main);中得到了未解决的“R”。 gradle输出也说:

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library
:app:prepareComAndroidSupportAppcompatV72400Library
:app:prepareComAndroidSupportSupportV42400Library
:app:prepareComAndroidSupportSupportVectorDrawable2400Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 31820177): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 10308796): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 25000613): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 14460031): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 4374283): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 5504361): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 26854796): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 10516242): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 32324093): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 27711675): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 30103954): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 18064832): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 24392487): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 26834549): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 193005): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 22524866): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 30685476): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 11160077): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 23466321): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
AAPT err(Facade for 29924546): /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: 5: /home/nllsdfx/Downloads/build-tools/24.0.0/aapt: Syntax error: end of file unexpected (expecting ")")
Exception in thread "png-cruncher_3" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_1" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_4" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_5" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_6" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "png-cruncher_10" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/nllsdfx/Downloads/build-tools/24.0.0/aapt 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.waitForReady(AaptProcess.java:108)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)

我试过:

  • 重新安装studio和sdk
  • 安装后更换sdk
  • 将SLAVE_AAPT_TIMEOUT设置为30秒
  • this主题
  • 的第一个回答
  • 启用离线工作(构建工具 - Gradle)

当然没有任何改变。我真的需要帮助。

3 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,只需使用版本23.0.x的aapt来解决它。

答案 1 :(得分:0)

使用build-tools 23.x.x确实有帮助,但我想知道发生了什么。

我很可能,x86 Linux,24.0.x构建工具中的所有二进制文件都是为x64构建的。

如果你file ./Sdk/build-tools/24.0.0/aapt ./aapt: ELF 64-bit LSB shared object, x86-64,我会得到类似./aapt: ELF 32-bit LSB shared object, Intel 80386的内容。显然是x64二进制文件。 (注意路径中的24.0.0)

相比之下23.0.0:Sub example() Dim wkSht As Worksheet Dim cel As Range For Each wkSht In ActiveWorkbook.Worksheets For Each cel In Sheets("Reporting").Range("B2:B200") If cel.Value = wkSht.Name Then wkSht.Range("D15").Copy Destination:=cel.Offset(0, 1) End If Next cel Next wkSht End Sub

这就是它。是时候重新安装系统了。

答案 2 :(得分:-1)

试试这个:sudo ./gradlew assembleRelease

我是在ubuntu 14.04 @ 32上做的,目标23当我尝试使用24或更多时我得到了:

error :<   "panie popierdolony" > Error: Failed to run command:
    /home/rea/Android/Sdk/build-tools/24.0.0/aapt s -i /home/rea/Android/Sdk/tools/App1/src/main/res/drawable-mdpi/ic_launcher.png -o /home/rea/Android/Sdk/tools/App1/build/intermediates/res/release/drawable-mdpi-v4/ic_launcher.png

我是如何使用目标23创建的,而我更改了buildToolsVersion '24.0.0'

相关问题