sky201503 / android-apktool2

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Problem with 'apktool b' -> could not exec command: [aapt, p, -F, etc.. #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just decompile framework-res -> apktool d..
2. I added a folder in res named 'values-nl' and in there a strings.xml
3. Then on building (apktool b) it gives this error:

Exception in thread "main" brut.androlib.AndrolibException: 
brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL131418499408821671.tmp, -x, -S, 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/res, -M, 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/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/APKTOOL131418499408821671.tmp, -x, -S, 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/res, -M, 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:83)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
    ... 6 more

What is the expected output? What do you see instead?

I expected to get a working apk file, I get the above error instead.

What version of the product are you using? On what operating system?

I'm using version 1.4.1 on Fedora 15 - x86_64

Please provide any additional information below.

I understand the error, the program cannot exec 'aapt, p, -F, etc..' because 
those comma's are not supposed to be there. Aapt runs fine on regular command 
line btw. Also the complete command (aapt p -F 
/tmp/APKTOOL131418499408821671.tmp -x -S 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/res -M 
/media/2tb/Android/miui/MIUI_new_translation/MIUI.us_saga_1.8.19_Eng_Deo_ZipA_Si
gned_SuperKid/system/framework/framework-res/AndroidManifest.xml) without the 
comma's runs fine.

Original issue reported on code.google.com by a.id...@gmail.com on 1 Sep 2011 at 4:01

GoogleCodeExporter commented 9 years ago
I have the same problem on Ubuntu 10.04 LTS. I have made some changes to 
AndroidManifest.xml. 

Exception in thread "main" brut.androlib.AndrolibException: 
brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL3329107106533909369.tmp, -I, /root/apktool/framework/1.apk, -S, 
/home/shimon/Downloads/decoded_music/res, -M, 
/home/shimon/Downloads/decoded_music/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/APKTOOL3329107106533909369.tmp, -I, /root/apktool/framework/1.apk, -S, 
/home/shimon/Downloads/decoded_music/res, -M, 
/home/shimon/Downloads/decoded_music/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:83)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
    ... 6 more

Original comment by shimon...@gmail.com on 6 Sep 2011 at 10:45

GoogleCodeExporter commented 9 years ago
Hmm.. that's really weird. If apktool can't run that command, you shouldn't be 
able to do that too :-/

Do you still get this error? Do you get it for particular apk file or for any 
of them?

Original comment by Brut.alll on 5 Nov 2011 at 10:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm having this issue as well.  Running on Ubuntu 11.10 64-bit

Exception in thread "main" brut.androlib.AndrolibException: 
brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL2547376524106737809.tmp, -I, /home/yhong/apktool/framework/1.apk, 
-S, /home/yhong/apktool/SystemUI/res, -M, 
/home/yhong/apktool/SystemUI/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/APKTOOL2547376524106737809.tmp, -I, /home/yhong/apktool/framework/1.apk, 
-S, /home/yhong/apktool/SystemUI/res, -M, 
/home/yhong/apktool/SystemUI/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:475)
    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

Original comment by yanc...@gmail.com on 30 Nov 2011 at 12:21

GoogleCodeExporter commented 9 years ago
I find that I can just move the effected files elsewhere and it will build fine 
:)

Original comment by fjfinnjo...@gmail.com on 4 Dec 2011 at 6:23

GoogleCodeExporter commented 9 years ago
also got this issue... don't know any solution. can anybody help to solve the 
problem?? thanks

Original comment by mrill...@gmail.com on 16 Dec 2011 at 8:20

GoogleCodeExporter commented 9 years ago
aapt, p, -F, /tmp/APKTOOL2547376524106737809.tmp, -I, 
/home/yhong/apktool/framework/1.apk, -S, /home/yhong/apktool/SystemUI/res, -M, 
/home/yhong/apktool/SystemUI/AndroidManifest.xml 要把里面的, 
这个去掉才能过。不过不知道怎么修改那个jar

Original comment by xhd3...@gmail.com on 21 Dec 2011 at 3:18

GoogleCodeExporter commented 9 years ago
@brut.all

Message from MIUI Devs on this framework plurals error...

"The tool cannot handle the string like "<item …> %d of  %d </item>", which 
contains two "%d". A workaround could be removing the second "%d", but it can 
result in a runtime error. :("

Original comment by markhedl...@gmail.com on 30 Dec 2011 at 9:30

GoogleCodeExporter commented 9 years ago
I have this error also

under Ubuntu 11.10;
apktool  v1.4.3

Exception in thread "main" brut.androlib.AndrolibException: 
brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL5150729603762710226.tmp, -I, /home/kdebarb/apktool/framework/1.apk, 
-S, /home/Flash_SGSI/ICS_Build/MyPackage/Build/Settings/res, -M, 
/home/Flash_SGSI/ICS_Build/MyPackage/Build/Settings/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:182)
    at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL5150729603762710226.tmp, -I, /home/kdebarb/apktool/framework/1.apk, 
-S, /home/Flash_SGSI/ICS_Build/MyPackage/Build/Settings/res, -M, 
/home/Flash_SGSI/ICS_Build/MyPackage/Build/Settings/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:83)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)

aapt command work!
aapt p -F /tmp/APKTOOL2538872800590172437.tmp, -I 
/home/kdebarb/apktool/framework/1.apk -S 
/home/Flash_SGSI/ICS_Build/MyPackage/Build/SystemUI/res -M 
/home/Flash_SGSI/ICS_Build/MyPackage/Build/SystemUI/AndroidManifest.xml
-> no error.

Original comment by kdebar...@gmail.com on 4 Jan 2012 at 7:45

GoogleCodeExporter commented 9 years ago
I found the reason for this issure.
cause you didn't set your apktool's path to your env's path
eg.excute command below:
export PATH=$PATH:/Users/game/tools; ./apktool b src_path output.apk
/Users/game/tools is apktool's path

Original comment by james.zh...@gmail.com on 17 Jan 2012 at 7:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 17 Nov 2012 at 8:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I my case it was caused by the aapt given by the apktool website (it seems to 
be outdated). Actually I just had to use in my path the aapt tool provided by 
the android sdk and know it works.

Original comment by quentinj...@gmail.com on 19 Dec 2012 at 8:01

GoogleCodeExporter commented 9 years ago
Many thanks @quentinj , you're right it works now :) after downloading 
"http://dl.google.com/android/adt/adt-bundle-linux-x86_64.zip" and using the 
aapt under "..../adt-bundle-linux-x86_64/sdk/platform-tools/"

Original comment by f.se...@gmail.com on 21 Dec 2012 at 6:23

GoogleCodeExporter commented 9 years ago
I am trying to install apktool 1.5.2 on my MAC but it says can not find 
apktool.jar

Original comment by jlev...@gmail.com on 12 Apr 2013 at 2:35

GoogleCodeExporter commented 9 years ago
Yeah, @quentinj's way works, I have set aapt's(under android sdk) path as the 
env variables

Original comment by Pengling...@gmail.com on 18 May 2014 at 7:21

GoogleCodeExporter commented 9 years ago
Can you send a useful aapt to me?  
mail: vistahack23@gmail.com
Sorry for my English :D

Original comment by vistahac...@gmail.com on 28 May 2014 at 2:46