# [Help] Error when trying to compile cm9 theme( theme chooser)



## shaiknbaik (Aug 27, 2011)

This error was solved by putting this aapt i found in the folder.
Hi everyone this error was solved by using the method above Hope it helps others!
Specs:
-i havent changed anything in the apk
-i am using apktool
-i am running windows 7 64bit
-i have sdk installed and updated (except the packages that require the motorola account or whatever)
-i have installed the framwork-res.apk from the rom i got the theme from
-and there may be other things i am forgetting to mention if so just ask and ill add it

Basically what i am asking is if someone could take a look at the attached errors and help me find out whats wrong. I appreciate all the help i can get!

Error:
C:\AndroidDev\apktool>apktool b ICERed
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\AndroidDev\apktool\ICERed\res/drawable-sw600
dp-mdpi
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Dustin\AppData\Local\Temp\
APKTOOL1486918560844794720.tmp, -x, -I, C:\Users\Dustin\apktool\framework\1.apk,
-S, C:\AndroidDev\apktool\ICERed\res, -M, C:\AndroidDev\apktool\ICERed\AndroidM
anifest.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\Dustin\AppData\Local\Temp\APKTOOL1486918560844794720.tmp, -x, -I, C:\Users\
Dustin\apktool\framework\1.apk, -S, C:\AndroidDev\apktool\ICERed\res, -M, C:\And
roidDev\apktool\ICERed\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more

After replacing the aapt.exe this is what i got:
C:\AndroidDev\apktool>apktool b ICERed.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
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.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more


----------



## wigsplittinhatchet (Nov 5, 2011)

Can't see your attached errors but when I set up my APK tool I would get errors as well even with unmodified apks. I had to replace the aapt.exe with the one included in my sdk tools. Try that out and see if it works for you

Sent from my DROIDX using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

wigsplittinhatchet said:


> Can't see your attached errors but when I set up my APK tool I would get errors as well even with unmodified apks. I had to replace the aapt.exe with the one included in my sdk tools. Try that out and see if it works for you
> 
> Sent from my DROIDX using RootzWiki


ok i will and get back to you also i will put the error in the post


----------



## shaiknbaik (Aug 27, 2011)

shaiknbaik said:


> ok i will and get back to you also i will put the error in the post


OK so i did that and it appears to have solved some errors here is what i got:
C:\AndroidDev\apktool>apktool b ICERed.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
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.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more

Also thank you for the tip on replacing the aapt!


----------



## bigshotrob22 (Jun 7, 2011)

When you build its apktool b (filename without .apk) and did u do the apktool if framework.apk (can't remember the exact words)

Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

bigshotrob22 said:


> When you build its apktool b (filename without .apk) and did u do the apktool if framework.apk (can't remember the exact words)
> 
> Sent from my Galaxy Nexus using RootzWiki


yes i did and i fixed all the errors thanks for the help everyone i have updated the thread in case others have problems. I do however have one problem! when installing the apk i get theme error saying it as improperly compiled blah blah blah... I have tried the work around many times and it doesnt work can someone help me thank you


----------



## Kevin3328 (Aug 22, 2011)

Have u signed the apk with a test key of some sort

R u using apk multi tool program?
Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

i signed it using this
http://forum.xda-dev...d.php?t=1466100
also i am using apktool


----------



## Kevin3328 (Aug 22, 2011)

OK u r using apk tool only.. I highly recommend u download the apk multi tool... however try this.. make sure your framework is properly set up.. take the framework.Res.apk and drop the apk where u r working.. type this command...

apktool.jar d framework-res.apk

apktool.jar if framework-res.apk

Let me know if this helps

Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

Kevin3328 said:


> OK u r using apk tool only.. I highly recommend u download the apk multi tool... however try this.. make sure your framework is properly set up.. take the framework.Res.apk and drop the apk where u r working.. type this command...
> 
> framework-res.apk d apktool.jar
> 
> ...


so this will get rid of the error i am having? and also i have apk multi-tool and i can use it if you think it would work better?


----------



## Kevin3328 (Aug 22, 2011)

I just modified my previous post.. apk multi tool is a full program that allows u to work on essentially hacking apks ... its the best tool when working in windows.. it provides a test key in the program and if u successfully compile the apk.. u will b able to install it without error

However the commands I posted were wrong b4.

Had a few cocktails today 
Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

i tried installing the framework and it didnt work someone else suggest since the app is both mdpi and xdpi i need to install two differnt frameworks? is this true


----------



## Kevin3328 (Aug 22, 2011)

Did u change the commands as I have modified my post?

R u working on a mdpi device 
Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

yes i did change theme then i decompiled, compiled, and signed again and same error:/ and i am using a galaxy nexus


----------



## Kevin3328 (Aug 22, 2011)

Dl apk multi tool .. then drop ur aapt.exe in the other folder and move your project to the apk multi tool

Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

do i drop the aapt.exe into the platform-tools folder?


----------



## Kevin3328 (Aug 22, 2011)

Once u dl apk multi tool.. if there is no other folder than yes.. put it in platform tools

Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

ok i did that and i moved the project what should i do now?


----------



## Kevin3328 (Aug 22, 2011)

Compile and sign

Sent from my Galaxy Nexus using RootzWiki


----------



## shaiknbaik (Aug 27, 2011)

i just tried i get these errors

2012-06-10 20:22:41 (4.31 MB/s) - `apkver.txt' saved [152/152]

A subdirectory or file projects already exists.
A subdirectory or file place-apk-here-for-modding already exists.
A subdirectory or file place-ogg-here already exists.
A subdirectory or file place-apk-here-to-batch-optimize already exists.
A subdirectory or file place-apk-here-for-signing already exists.
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
'""platform-tools"\adb.exe"' is not recognized as an internal or external comman
d,
operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Dustin\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Dustin\AppData\Local\Temp\
APKTOOL133475155565806360.tmp, -x, -I, C:\Users\Dustin\apktool\framework\1.apk,
-S, C:\AndroidDev\APK-Multi\projects\ICERed.apk\res, -M, C:\AndroidDev\APK-Multi
\projects\ICERed.apk\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\Dustin\AppData\Local\Temp\APKTOOL133475155565806360.tmp, -x, -I, C:\Users\D
ustin\apktool\framework\1.apk, -S, C:\AndroidDev\APK-Multi\projects\ICERed.apk\r
es, -M, C:\AndroidDev\APK-Multi\projects\ICERed.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more


----------



## Kevin3328 (Aug 22, 2011)

Dude I really want to help u.. how about u send me a pm with a link to the sucesfully compiled apk and we can discuss this on gtalk and have the mods close the thread.. pm me with the apk and a gtalk invite and I'll get back to u tomorrow if this sounds good...

Sent from my Galaxy Nexus using RootzWiki


----------

