Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when I run Apktool to build a package for android I get this output:

:~$ apktool build '/home/...' I: Checking whether sources has changed... I: Checking whether resources has changed... I: Building resources... Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException:
could not exec command: aapt, p, -F, /tmp/APKTOOL3418222472327622786.tmp, -I,
/home/apktool/framework/1.apk, -S, /home/.../ /home/.../AndroidManifest.xml] at brut.androlib.res.AndrolibResources.aaptPackage( at brut.androlib.Androlib.buildResourcesFull( at brut.androlib.Androlib.buildResources( at at at brut.apktool.Main.cmdBuild( at brut.apktool.Main.main( Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL3418222472327622786.tmp, -I, /home/.../.../framework/1.apk, -S, /home/.../.../res, -M, /home/.../.../AndroidManifest.xml] at brut.util.OS.exec( at brut.androlib.res.AndrolibResources.aaptPackage( ... 6 more Caused by: Cannot run program "aapt": error=2, No such file or directory at java.lang.ProcessBuilder.start( at java.lang.Runtime.exec( at java.lang.Runtime.exec( at brut.util.OS.exec( ... 7 more Caused by: error=2, No such file or directory at java.lang.UNIXProcess.( at java.lang.ProcessImpl.start( at java.lang.ProcessBuilder.start( ... 10 more

It seems like a PATH problem because it can't access aapt however my PATH is located in ~/pam_enviorment and is the following:

PATH DEFAULT=${PATH}:~/myTerminal                                        
PATH DEFAULT=${PATH}:~/myTerminal/aapt

Any constructive feedback is welcomed.

share|improve this question

As of apktool v1.5.1 I added support for passing the path to apktool via --aapt/-a, so on rebuild just use apktool b --aapt /path/to/aapt nameofapkfolder. So update your apktool and forget messing around with path variables.

As for the path problem. What happens on echo $PATH?

share|improve this answer

It definitely seems like the aapt PATH problem I had a while back. I'm sure you have this all sorted out by now, but for other Linux users who may have the same problem, I have made a good apk kit in bash to avoid all these dependency problems called apk munky-rench. Check it out.

At initial release, apk munky-rench has the following features:

  • Unzip Apk
  • Zip APK
  • Install Frameworks
  • Decompile Apk
  • Compile Apk
  • Sign Apk
  • Zipalign Apk
  • Compile System Apk
  • ADB Install
  • ADB Push/Pull
  • Fastboot Flash Recovery
  • Heimdall Flash Recovery
  • Supports Samsung devices through onboard Heimdall
  • Flashable Zip Generator
  • Lollipop Compatibility
  • Brief Explanations of Features
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.