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

AAPT错误无尽gradle构建

邓英卓
2023-03-14

我已经在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

当然没什么变化。我真的需要帮助。


共有3个答案

蒯慈
2023-03-14

试试这个:sudo./gradlew程序集发布

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

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

我是如何用target 23创建的,我改变了buildToolsVersion'24.0。0'

牧献
2023-03-14

使用构建工具23. x. x真的很有帮助,但是我想知道发生了什么。

我运行的是x86Linux,所有的二进制文件都是24.0版本。x构建工具是为x64构建的。

如果您使用文件/Sdk/构建工具/24.0。0/aapt您将得到类似的/aapt:ELF 64位LSB共享对象,x86-64。显然是x64二进制文件。(路径中的注意事项24.0.0)

相比之下,23.0。0:/aapt:ELF 32位LSB共享对象,英特尔80386

所以就这样了。是时候重新安装系统了。

齐才艺
2023-03-14

我也有同样的问题,用23.0. x版的aapt就解决了。

 类似资料:
  • 将一个旧项目上的Gradle更新为最新版本,我收到以下错误:。gradle\caches\transforms-1\files-1.1\CreditCardEntry-1.4.8.10。aar\453339e1f1fb2382e8ce2362a0acdedd\res\values\values。xml:11:5-54:AAPT:error:内部元素必须是资源引用或为空。 我不明白为什么会出现这个错

  • 问题内容: 当我编译一个android应用程序时(我尝试了sdk中的示例程序)。我收到此错误: 但是aapt在那个位置吗? 注意:我也收到错误“ R无法解决”,但是我很确定在解决问题1时,我也解决了这个问题 问题答案: Ubuntu 14.04.1 LTS解决方案: 原因:aapt需要安装32位库

  • 我试图用Gradle建立我的Android Studio项目。然而,我不断收到以下错误。 执行任务“:app:MergedebugResources”失败。 executionexception:com.Android.builder.internal.aapt.v2.aapt2exception:Android资源编译失败C:\users\rhnow.gradle\caches\transfor

  • 我正在用react native开发我的android应用程序,现在我想构建一个发布版apk,通过Play store上传它,但当我尝试构建它时,显示以下错误 > 我在网上搜索并添加了android。ENABALEAPT2=在渐变上为false。属性,但它始终显示相同的结果。我遵循了此链接中的所有步骤https://facebook.github.io/react-native/docs/sign

  • 我安装了Android Studio 2.2。2使用Debian Jessie上的必要软件包并检查更新 当gradle构建开始时,我有2个错误: 错误:java.lang.运行时间异常:CrunchingCruncherlauncher.png失败,请参阅日志错误:任务执行失败:应用程序:mergeDebugResources。 我在这个论坛上寻找答案,我试图通过编辑/res/drawable文件

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