Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I solve the brut.androlib.AndrolibException

I am having the following exception after decoding the apk in debug mode and trying to build a new apk in debug mode. I am confused and I don't what to do. when I try the following I am getting exactly the same result.

$java -jar ./apktool.jar d -d meet.apk out
$java -jar ./apktool.jar b -d out meet.apk

or this

$./apktool d -d meet.apk out
$./apktool b -d out meet.apk

I get the following output

I: Checking whether sources has changed...
I: Smaling...
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/APKTOOL4160944918573250929.tmp, -I, /root/apktool/framework/1.apk, -S, /home/lab2alex/Documents/out/res, -M, /home/lab2alex/Documents/out/AndroidManifest.xml]
  at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL4160944918573250929.tmp, -I, /root/apktool/framework/1.apk, -S, /home/lab2alex/Documents/out/res, -M, /home/lab2alex/Documents/out/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:488)
at java.lang.Runtime.exec(Runtime.java:610)
at java.lang.Runtime.exec(Runtime.java:483)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
... 10 more

what should I do

like image 384
eskoba Avatar asked Nov 12 '22 00:11

eskoba


1 Answers

In case you've been using v1 and now upgraded to v2, try manually deleting the framework file.

On windows 8 it's normally at C:\Users\YourName\apktool\framework\1.apk.

The file should be regenerated once you try to build something.

like image 52
Michael Litvin Avatar answered Nov 15 '22 13:11

Michael Litvin