sky201503 / android-apktool-1

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

Error Building Android 4.1.2 SystemUI.apk #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When i try to build the apk with or without modification result an error.

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

c:\apktool>apktool d SystemUI.apk
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\kry\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

c:\apktool>apktool b -d SystemUI prova.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: c:\apktool\SystemUI\res/drawable-sw600dp
invalid resource directory name: c:\apktool\SystemUI\res/drawable-sw600dp-213dpi

invalid resource directory name: c:\apktool\SystemUI\res/drawable-sw600dp-hdpi
invalid resource directory name: c:\apktool\SystemUI\res/drawable-sw720dp-213dpi

invalid resource directory name: c:\apktool\SystemUI\res/drawable-sw720dp-hdpi
invalid resource directory name: c:\apktool\SystemUI\res/layout-sw600dp
invalid resource directory name: c:\apktool\SystemUI\res/layout-sw720dp
invalid resource directory name: c:\apktool\SystemUI\res/values-sw600dp
invalid resource directory name: c:\apktool\SystemUI\res/values-sw600dp-land
invalid resource directory name: c:\apktool\SystemUI\res/values-sw600dp-port
invalid resource directory name: c:\apktool\SystemUI\res/values-sw720dp
invalid resource directory name: c:\apktool\SystemUI\res/values-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\kry\AppData\Local\Temp\APK
TOOL4522123133127285049.tmp, -I, C:\Users\kry\apktool\framework\1.apk, -S, c:\ap
ktool\SystemUI\res, -M, c:\apktool\SystemUI\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a: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, C:\U
sers\kry\AppData\Local\Temp\APKTOOL4522123133127285049.tmp, -I, C:\Users\kry\apk
tool\framework\1.apk, -S, c:\apktool\SystemUI\res, -M, c:\apktool\SystemUI\Andro
idManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
        ... 6 more

c:\apktool>

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

apktool1.4.3, windows 7 professional 32bit, Android 4.1.2

Original issue reported on code.google.com by mariani...@gmail.com on 13 Oct 2012 at 11:47

GoogleCodeExporter commented 9 years ago
I have the exact same problem. APKTool 1.4.3, Win 7 64-bit, Android 4.1.1

Original comment by exsc...@gmail.com on 15 Oct 2012 at 6:06

GoogleCodeExporter commented 9 years ago
So I think I understand the issue here.  It comes from using a manifest that 
has unix style directory structures, but recompiling on a Windows machine.

Taking the error: "invalid resource directory name: 
c:\apktool\SystemUI\res/drawable-sw600dp"

Resource paths from the manifest will be built in the style 
"res/drawable-sw600dp", which is then appended to the current working directory 
(c:\apktool\SystemUI\) resulting in a path of 
"c:\apktool\SystemUI\res/drawable-sw600dp"

However this is not a valid path in Windows -- that "/" between res and 
drawable should be a "\"

I'm fairly new to Android so I can't say if this is an aapt issue or a manifest 
issue (feel free anyone else to chime in), but I am fairly certain the issue is 
in this area.

Original comment by peter.sa...@gmail.com on 18 Oct 2012 at 7:30

GoogleCodeExporter commented 9 years ago
Your aapt is out of date. 

invalid resource directory names have to do with aapt. Nothing to do with 
Apktool.

Original comment by connor.tumbleson on 15 Nov 2012 at 12:51

GoogleCodeExporter commented 9 years ago
I have the same problem and I downloaded latest Android SDK....But still same 
problem existing..how can I solve it?

Original comment by jisha...@gmail.com on 30 Jan 2013 at 4:36

GoogleCodeExporter commented 9 years ago
Your aapt is out of date. That is the problem. Go check ALL your aapts. This is 
not a bug.

Original comment by connor.tumbleson on 30 Jan 2013 at 4:37