[Android Q&A, Help & Troubleshooting] Jim_K:
Wondering if someone with more than 10 posts can drop this over in the dev forum for apktool 1.5?

There appears to be a bug in the way the tool handles paths on windows computers with some apk's. A sample apk is the Launcher2.apk from 4.1.2.

It decodes fine, but turning around to immediately build it again results in:

C:\Launcher2\4.1.2\Launcher2.stock>apktool b -f

I: Smaling...

I: Building resources...

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw600dp-hdpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw600dp-land-hdpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw600dp-nodpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw600dp-xhdpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw720dp-land-hdpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/drawable-sw720dp-nodpi

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/layout-sw600dp-port

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/layout-sw720dp

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/layout-sw720dp-land

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/layout-sw720dp-port

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw340dp

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw340dp-land

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw340dp-port

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw600dp

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw600dp-land

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw600dp-port

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw720dp

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw720dp-land

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/values-sw720dp-port

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/xml-sw600dp

invalid resource directory name: C:\Launcher2\4.1.2\Launcher2.stock\.\res/xml-sw720dp

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p,

--min-sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\akuiphj\AppData\Local\Temp\APKTOOL7573147755302264770.tmp

, -I, C:\Users\akuiphj\apktool\framework\1.apk, -S, C:\Launcher2\4.1.2\Launcher2.stock\.\res, -M, C:\Launcher2\4.1.2\Lau

ncher2.stock\.\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:255)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)

at brut.androlib.Androlib.buildResources(Androlib.java:269)

at brut.androlib.Androlib.build(Androlib.java:192)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:188)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16,

-F, C:\Users\akuiphj\AppData\Local\Temp\APKTOOL7573147755302264770.tmp, -I, C:\Users\akuiphj\apktool\framework\1.apk, -

S, C:\Launcher2\4.1.2\Launcher2.stock\.\res, -M, C:\Launcher2\4.1.2\Launcher2.stock\.\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:253)

... 6 more

I was able to build the apk on linux so I'm pretty sure its a windows only problem with the handling of / vs \.

(as a side, holy crap, who made the captcha's on this site?! They are impossible!)