6

I've installed Android Studio on Ubuntu 16.04 x64. When start new project I get unresolved 'R' in setContentView(R.layout.activity_main);. Also gradle output says:

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)

I've tried to do:

  • Reinstall studio and sdk
  • Replace sdk after installation
  • Set SLAVE_AAPT_TIMEOUT to 30 seconds
  • First answer from this topic
  • Turn on offline work (Build tools-Gradle)

Sure nothing changed. I really need help.

Community
  • 1
  • 1
nllsdfx
  • 900
  • 14
  • 30

3 Answers3

1

I have the same problem, and just solve it by using the aapt of version 23.0.x.

liu-seldon
  • 26
  • 3
0

Using build-tools 23.x.x really helps, but I think to know what's happening.

I run, you too probably, x86 Linux, and all binaries in 24.0.x build-tools are built for x64.

If you do file ./Sdk/build-tools/24.0.0/aapt you'll get something like this ./aapt: ELF 64-bit LSB shared object, x86-64. Obviously x64 binary file. (Notice 24.0.0 in path)

In contrast for 23.0.0: ./aapt: ELF 32-bit LSB shared object, Intel 80386.

So that's it. Time to reinstall system.

Nemanja
  • 154
  • 2
  • 10
-1

try this: sudo ./gradlew assembleRelease

I did it on ubuntu 14.04 @32, with target 23 when I try usage 24 or more I get:

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

How ever I created with target 23 and I changed buildToolsVersion '24.0.0'

Robert
  • 10,403
  • 14
  • 67
  • 117