Android Hello-World compile error: Intellij cannot find aapt

后端 未结 13 1904
感情败类
感情败类 2020-12-02 09:45

I\'m trying to get set up with an Android development environment using IntelliJ in Ubuntu 12.04. I create an Android Application Module, but when I try to build, I get the

相关标签:
13条回答
  • 2020-12-02 09:59

    The same problem occurred for me with android-studio. But, this probably applies to the IntelliJ IDE as well.

    When checking the file location I saw, however, that aapt was in the expected location.

    In my case the issue was that I was running a 64-bit Ubuntu linux system which cannot execute the 32-bit aapt executable.

    Installing 32-bit compatibility libraries solved this issue in my case: sudo apt-get install ia32-libs

    0 讨论(0)
  • 2020-12-02 10:01

    I ran these three commands and my problem was resolved

    mklink "%ANDROID_HOME%\platform-tools\aapt.exe" "%ANDROID_HOME%\build-tools\17.0.0\aapt.exe"
    
    mklink /D "%ANDROID_HOME%\platform-tools\lib" "%ANDROID_HOME%\build-tools\17.0.0\lib"
    
    mklink "%ANDROID_HOME%\platforms\android-17\tools" "%ANDROID_HOME%\build-tools\17.0.0\aidl.exe"
    

    If you haven't set ANDROID_HOME Environmental variable the replace %ANDROID_HOME% with the path to your android SDK e.g. C:\Android\android-sdk

    0 讨论(0)
  • 2020-12-02 10:03

    I also noticed it.

    ADT has been updated and they added this new build-tools where they moved everything. Intellijidea is not updating paths so it's searching aapt in the old path.

    I don't know how to solve it, so let me know if you find a solution...

    UPDATE:

    I think that you have only 2 options:

    1) Use Android Build studio: http://developer.android.com/sdk/installing/studio.html 2) Copy (this is dirty but works) all content from build-tools/17.0.0/ to platform-tools/ and it will build

    0 讨论(0)
  • 2020-12-02 10:03

    Thanks for the tip! On a mac running the Android 4.2.2 SDK, this worked great. You'll just need to update your paths accordingly. E.g.

    ln -s ../build-tools/android-4.2.2/lib lib

    ln -s ../build-tools/android-4.2.2/aapt aapt

    0 讨论(0)
  • 2020-12-02 10:07

    To complain to Jetbrains, go here: http://youtrack.jetbrains.com/issue/IDEA-107311

    I reckon more votes will be a faster fix.

    0 讨论(0)
  • 2020-12-02 10:08

    On Mac OS you need to

    $ cd platform-tools
    $ ln -s ../build-tools/android-4.2.2/aapt aapt
    $ ln -s ../build-tools/android-4.2.2/lib lib
    
    0 讨论(0)
提交回复
热议问题