[Xperia Arc Q&A, Help & Troubleshooting] MaxFTW:
I had been looking before for the same thread I created, but I hadn't found so I created this one. I want to mod some apps for my Jelly Sandwich. Decompiling goes well, but recompiling - error!

This what I exactly do:

apktool if framework-res.apk (success)

apktool d SystemUI.apk (success)

apktool b SystemUI.apk (error)

This is what I get after recompiling command:

I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not write dex
to file: SystemUI\build\apk\classes.dex
at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:222)
at brut.androlib.Androlib.buildSources(Androlib.java:179)
at brut.androlib.Androlib.build(Androlib.java:170)
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: java.io.FileNotFoundException: SystemUI\build\apk\classes.dex (Odmowa
dostŕpu)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:57)
... 8 more

Even without changing anything, apktool doesn't recompile my apk.

I have tried to recompile on two PCs - both of them have latest Java software installed.

I could post it in General Android section, but I think it can be related with Xperia only.

-----------------EDIT------------------------

I got something like that once also:

I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/drawab
le-sw600dp-hdpi
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/layout
-sw600dp
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw600dp
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw600dp-port
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw720dp
invalid resource directory name: C:\Users\JA\Desktop\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\JA\AppData\Local\Temp\APKT
OOL5816768975862364769.tmp, -I, C:\Users\JA\apktool\framework\1.apk, -S, C:\User
s\JA\Desktop\apktool\SystemUI\res, -M, C:\Users\JA\Desktop\apktool\SystemUI\Andr
oidManifest.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\JA\AppData\Local\Temp\APKTOOL5816768975862364769.tmp, -I, C:\Users\JA\apkto
ol\framework\1.apk, -S, C:\Users\JA\Desktop\apktool\SystemUI\res, -M, C:\Users\J
A\Desktop\apktool\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more