sky201503 / android-apktool-1

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

Cannot recompile unchanged apk -- invalid resource directory name && exception in thread "main" -- brut.common.BrutException: could not exec command: [aapt, p, -F, tmp/........ #282

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.decompile SystemUI.apk to a /home/<user>/Desktop/directory
2.make no changes
3.recompile SystemUI.apk

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

joe@joe-laptop:~$ apktool d -f /home/joe/Desktop/Gummy-System-UI/SystemUI.apk 
/home/joe/Desktop/decompiled/
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: /home/joe/apktool/framework/1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
joe@joe-laptop:~$ apktool b -f /home/joe/Desktop/decompiled/
I: Smaling...
I: Building resources...
invalid resource directory name: 
/home/joe/Desktop/decompiled/res/values-sw720dp-port
invalid resource directory name: /home/joe/Desktop/decompiled/res/layout-sw600dp
invalid resource directory name: 
/home/joe/Desktop/decompiled/res/drawable-sw600dp-xhdpi
invalid resource directory name: /home/joe/Desktop/decompiled/res/values-sw600dp
invalid resource directory name: /home/joe/Desktop/decompiled/res/values-sw720dp
invalid resource directory name: 
/home/joe/Desktop/decompiled/res/values-sw600dp-port
Exception in thread "main" brut.androlib.AndrolibException: 
brut.common.BrutException: could not exec command: [aapt, p, -F, 
/tmp/APKTOOL591981309543279324.tmp, -I, /home/joe/apktool/framework/1.apk, -S, 
/home/joe/Desktop/decompiled/res, -M, 
/home/joe/Desktop/decompiled/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/APKTOOL591981309543279324.tmp, -I, /home/joe/apktool/framework/1.apk, -S, 
/home/joe/Desktop/decompiled/res, -M, 
/home/joe/Desktop/decompiled/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:83)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
    ... 6 more
joe@joe-laptop:~$ 

What version of the product are you using? On what operating system?
apktool 1.4.3 on 64-bit Ubuntu 10.04

Please provide any additional information below.

I can't recompile the apk to a different directory, either. Also, aapt works 
fine from the terminal.

Original issue reported on code.google.com by rizh...@gmail.com on 1 Jan 2012 at 11:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
fresh Ubuntu install, so everything is up to date.
The SystemUI.apk is from GummyNex AOSP 4.0.3

Original comment by rizh...@gmail.com on 1 Jan 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Its been verified here, if you want to "star" and await the fix.

http://code.google.com/p/android-apktool/issues/detail?id=277&sort=-id&colspec=I
D%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary

Original comment by connor.tumbleson on 2 Jan 2012 at 11:34

GoogleCodeExporter commented 9 years ago
i had this problem, exception in main yadadadada

update your aapt. make sure sdk tools is updated to latest version for your 
android version your trying to build. go into platform-tools, look for 
aapt-backup, if its there (it was for me, and was the actual NEWER one)

do:

sudo su

cd home/USERNAME/DIRECTORY/SDK-IS-IN/platform-tools
cp aapt-backup /usr/local/bin/aapt

worked for me...

Original comment by YounGunn@gmail.com on 19 Apr 2012 at 6:16

GoogleCodeExporter commented 9 years ago
You must use an updated aapt, the same that comes from Themes apks.

Original comment by raf...@gmail.com on 6 Jul 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Just replace old aapt in /usr/local/bin/ with new one from your platform-tools 
directory.

Original comment by kopylovp...@gmail.com on 16 Jul 2012 at 1:53

GoogleCodeExporter commented 9 years ago
#6, Thank you, worked for me here in Windows 64bit. Just copy aapt to 
C:\Windows\ folder.

Original comment by kot...@gmail.com on 8 Aug 2012 at 8:49

GoogleCodeExporter commented 9 years ago
#6, Thank you too, used SDK's aapt instead of the one from apktool repo 
successfully. Hope apktool's version will be improved to avoid this issue.

Original comment by fr0st.br...@gmail.com on 16 Aug 2012 at 4:44

GoogleCodeExporter commented 9 years ago
This happened to me as well, and the above fix worked. In my case, I had the 
android sdk binary directories (tools, platform-tools) on my PATH, but because 
apktool installed its old aapt into /usr/local/bin the old version was being 
called - and would have been from anything in the SDK trying to use it as well! 

Suggest to make android sdk a prereq for apktool and use the aapt binary 
distributed with it - either explain how to add android SDK to PATH in the 
install doc, or symlink /usr/local/bin/aapt to $SDK/platform-tools/aapt, 
instead of distributing aapt with apktools.

JB

Original comment by barc...@gmail.com on 21 Sep 2012 at 4:29

GoogleCodeExporter commented 9 years ago
THe OP issue is outdated aapt.

Original comment by connor.tumbleson on 16 Nov 2012 at 11:52

GoogleCodeExporter commented 9 years ago
In this way today I also fixed my problem. The framework-res.apk was not 
compiling; so just updated aapt.exe from sdk and also updated the apktool to 
1.5 version. Now works great.

Original comment by bappi.ru...@gmail.com on 1 Dec 2012 at 1:42

GoogleCodeExporter commented 9 years ago
Replacing aapt from the one in android sdk, it worked for me too

Original comment by celik.e...@gmail.com on 2 Dec 2012 at 11:17

GoogleCodeExporter commented 9 years ago
I met the same problem, tried use the latest aapt in google android sdk, it 
doesn't work.
Finally I got a aapt from 
https://github.com/MiCode/patchrom_tools/blob/jellybean/aapt
then it works.
Hope this can help you.

Original comment by truly...@gmail.com on 16 Jan 2013 at 5:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
#9, Thanks a lot! I also have the sdk binary directories on my PATH, so I 
thought apktool would use the aapt from the PATH. Seems that apktool cannot run 
aapt this way, however, adding aapt to /usr/local/bin/ works.  
BTW, I'm using apktool 1.5.2

Original comment by xabis...@gmail.com on 22 Mar 2013 at 8:18

GoogleCodeExporter commented 9 years ago
@#6  it worked for me too.

Original comment by yuqian...@gmail.com on 9 Jun 2013 at 9:35

GoogleCodeExporter commented 9 years ago
@#6 it also works for me. thanks

Original comment by Lanj...@gmail.com on 12 Jan 2014 at 7:59

GoogleCodeExporter commented 9 years ago
What is aapt

Original comment by mohadria...@gmail.com on 14 Nov 2014 at 12:28