# Help Compiling ROM



## lpjunior999 (Jan 20, 2012)

So I'm trying my hand at ROM development, considering MIUI has gone open source and there's a guide on patching it into your phone here. I've been figuring out the process through trial and error, and have managed to decompile all the apps, get the GB OTA in there, etc. My problem is I'm running Windows 7 (decompiled in Win7, amazingly), and have no experience in Linux at all. I've got Cygwin installed, but not sure how to use it to do things like define where my folder is and use tools, which I need if I'm going to compile this ROM and test it out.

Yes I am a total n00b and you have permission to facepalm.


----------



## andrewjt19 (Oct 27, 2011)

I'm no developer, but try using a virtual box instead if cygwin. Then download Ubuntu 10.4 Lts. Its the best right now arguably.

Sent from my SCH-I510 using RootzWiki


----------



## lpjunior999 (Jan 20, 2012)

Yeah, I probably should. I figured out Cygwin mostly but for whatever reason it can't recognize a .jar file it needs to in order to compile. Maybe I'll get lucky and someone else will figure all this out before me.


----------



## lpjunior999 (Jan 20, 2012)

I've full-on made an Ubuntu installation, but now I'm getting other random errors. Anyone know what this means?


```
<br />
<br />
build .build/services.jar...<br />
--------------------------------------------<br />
cp -r services.jar.out/ .build/services<br />
/home/kyle/MiCode/tools/add_miui_smail.sh .build/services_miui .build/services<br />
/home/kyle/MiCode/tools/apktool b .build/services .build/services.jar<br />
I: Checking whether sources has changed...<br />
W: Could not find resources<br />
I: Building apk file...<br />
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /home/kyle/MiCode/i9100/.build/services.jar, /home/kyle/MiCode/i9100/.build/services/build/apk]<br />
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)<br />
    at brut.androlib.Androlib.buildApk(Androlib.java:355)<br />
    at brut.androlib.Androlib.build(Androlib.java:174)<br />
    at brut.androlib.Androlib.build(Androlib.java:154)<br />
    at brut.apktool.Main.cmdBuild(Main.java:182)<br />
    at brut.apktool.Main.main(Main.java:67)<br />
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /home/kyle/MiCode/i9100/.build/services.jar, /home/kyle/MiCode/i9100/.build/services/build/apk]<br />
    at brut.util.OS.exec(OS.java:87)<br />
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)<br />
    ... 5 more<br />
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=2, No such file or directory<br />
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)<br />
    at java.lang.Runtime.exec(Runtime.java:610)<br />
    at java.lang.Runtime.exec(Runtime.java:483)<br />
    at brut.util.OS.exec(OS.java:78)<br />
    ... 6 more<br />
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory<br />
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)<br />
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)<br />
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)<br />
    ... 9 more<br />
make: *** [.build/services.jar] Error 1<br />
```


----------



## imnuts (Jun 9, 2011)

It doesn't look like everything is setup properly. Looks like you're missing the command "aapt"


----------



## lpjunior999 (Jan 20, 2012)

Yeah I'm finding that out despite my best efforts. I actually have aapt in my sdk tools, but maybe that's not the issue. Is there a good post around for setting up the proper environment?


----------



## MidnightNinja (Dec 10, 2011)

https://sites.google.com/a/imnuts.net/android/how-tos/setup-development-environment
From what I hear, thatll get you started


----------



## motcher41 (Dec 19, 2011)

Am I mistaken that cm is required to have miui isn't it since some of miui comes from cm that's just what I heard from every other phone I been on

sent from my eclipsed chargecrack


----------



## lpjunior999 (Jan 20, 2012)

I can't claim to know all the details, but apparently this takes a GB rom and patches it to MIUI. I think only a few people have successfully patched and released ROMs though, so I'm not sure how well it works. I'll post it up if I get it to actually compile and run. Speaking of which;



I think this is saying it can't find apktool.ymj, which is bananas because I can see apktool in there and I added android-sdk-linux to my path. Is there an alternative way to install apktool so that it will d & c?


----------

