# Trouble Building From Source



## patrick (Jul 25, 2011)

Preface: I'm a noob







I decided that I wanted to try building a ROM, but I've been having a lot of trouble with getting source code...

I'm running Ubuntu 11.10, and I followed this CyanogenMod guide exactly, but something's going wrong... I made a bin directory in my home folder, as well as the android/system, then made the repo with this:

```
curl [URL=https://dl-ssl.google.com/dl/googlesource/git-repo/repo]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/URL] > ~/bin/repo
```
which worked successfully, then ran this and then rebooted:

```
chmod a+x ~/bin/repo
```
.

I cd'ed into the android/system dir and ran this:

```
repo init -u [URL=git://github.com/CyanogenMod/android.git]git://github.com/CyanogenMod/android.git[/URL] -b gingerbread
```
.

I don't know if this did what it should have done, because I got this output "repo initialized in /home/patrick" instead of what I was expecting, which was something along these lines: "repo initialized in /home/patrick/android/system." I made sure that I my working directory was still right, and it was still android/system. I don't know if that was right or not, but I assumed it was since I had literally copied and pasted the lines from the wiki.

After that was all done, I typed

```
<br />
repo sync -j16<br />
```
It did a bunch of stuff that looked right, and took FOREVER to be done. Well, really I don't think it really ever finished. I let it go for a few hours but when I came back it was stuck like this.









I gave it some time to work, hoping it would start up again, but nothing happened so I closed the terminal.

I checked my home folder and it was cluttered with all of the folders and files from the attempted download of the source, instead of them being in /android/system where they should have been. Needless to say I'm pretty frustrated now, because after deleting all of the extra stuff I decided to try redoing the whole process, but now it just fetches projects and syncs the work tree but doesn't download anything new.

Any help is much appreciated, I just want to start by building my own nightly kang for now, but I can't until I have CM source









ALSO: Bonus points if someone can help me sync the ICS branch for CM9, I tried that too but got the same-ish errors, I don't know if you CAN sync it yet but I think it would be pretty cool to try building my own nightlies of that for the Incredible too!


----------



## patrick (Jul 25, 2011)

Also, what is the difference between "repo sync" and "repo sync -j16"? CyanogenMod says to use the latter, but I saw the former in a tutorial.

EDIT: Never mind about the -j16 part, I was told it specifies how many jobs to work on at a time. Still need help with everything else though!


----------



## JBirdVegas (Jun 11, 2011)

it may not be lagging some of these repos are +gigabyte size

but if it is lagging ^z (control z) then just repo sync again this time drop down from j16 and just try j8 till you get the majority of the code local

repo can get confused if you give it too many jobs and the system may not be truly able to handle it


----------



## patrick (Jul 25, 2011)

I don't think it was still trying to download anything, I kind of cut it off in the picture, but underneath the last line was a blank line, and there was no progress update or percentage or anything, just a blinking cursor...


----------



## JBirdVegas (Jun 11, 2011)

Bottom line if repo lags ...try again.

Could be the jobs, could be an uncaught error, could be gerrit code reviewer is pushing right then, could be git related or github could be having problems

But it you don't get an error and it is frozen just drop the process and sync again


----------



## patrick (Jul 25, 2011)

I decided to install 64 bit Ubuntu instead of 32 bit, I don't know why I chose 32 in the first place but I read that you need 64 for building the source anyways. I'm currently still just downloading the SDK, but tomorrow I am going to try the getting the source again and hopefully it will work this time. Maybe all I needed was a clean slate, but I'll let you know tomorrow how it goes, fingers crossed!


----------



## EmericanX (Sep 24, 2011)

I'll be keeping eyes on this thread. I cant help much but im planning on taking the leap soon. I like to learn from any resource possible... and ut looks like this may be a good one. Keep us posted!

Sent from my DROID BIONIC using Tapatalk


----------



## patrick (Jul 25, 2011)

Grrr...

I have all the source and everything, but every time I try to compile, I have tried several times, I get this error!










I don't know what's happening, but when I go to android/system/out/target/product/inc, the only stuff that's there is this...










I'm still following the CyanogenMod wiki guide, so I used ". build/envsetup.sh" and then "brunch inc" to _attempt_ to build the source code...


----------



## JBirdVegas (Jun 11, 2011)

Try repo sync again

Or

repo sync --local-only


----------



## patrick (Jul 25, 2011)

JBirdVegas said:


> Try repo sync again Or repo sync --local-only


I deleted everything and repo synced again, but still got the same error.

Also, as a side note, when I was trying to install the build packages for building CM on a 64-bit machine


```
<br />
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib<br />
```
It can't find the gcc-4.3-multilib g++-4.3-multilib, which was apparently expected and no longer necessary, but it ALSO can't find this: lib32readline5-dev. I Googled around and couldn't really find anything about it, someone somewhere said it should still build fine, but I'm starting to get suspicious of that package... Do you know anything about it?


----------



## JBirdVegas (Jun 11, 2011)

seems like your missing build dependancies try

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils

notice the incompatible version lines


----------



## patrick (Jul 25, 2011)

I have all of those things except for:
lib32readline5-dev: No installation candidate - The available lib32readline packages are "lib32readline5 lib32readline6 lib32readline6-dev and lib32readline-gplv2-dev

lib32z-dev: It tells me that it's installing lib32z1-dev instead, and installs that

I was missing mingw32 tofrodos python-markdown and libxml2-utils but they all installed just fine.

I guess the problem is with the lib32readline whatever package, which one(s) should I install?


----------



## JBirdVegas (Jun 11, 2011)

install them all can't hurt; although I don't think you will need all of them


----------



## patrick (Jul 25, 2011)

I installed them, now I'm going to try to build again


----------



## patrick (Jul 25, 2011)

The build worked! Thank you JBird!!!


----------



## JBirdVegas (Jun 11, 2011)

patrick said:


> The build worked! Thank you JBird!!!


Glad to hear it


----------



## patrick (Jul 25, 2011)

And now JBird, one more question...

I'm getting the Galaxy Nexus tomorrow FOR SURE, and I'm going to want to play around with ROMs and stuff there too. I know that the most recent AOSP source listed on the website is 4.0.1r1.2, but I read that 4.0.2 was just released for the LTE Nexus. When I sync CM, I can just use the repo init command for the ics branch, is there an equivalent for the AOSP source, or do I have to just know the most recent version to sync it?


----------



## JBirdVegas (Jun 11, 2011)

Just stay on the main branch ie don't specify a branch


----------



## patrick (Jul 25, 2011)

So use this?


```
<br />
repo init -u [URL=https://android.googlesource]https://android.googlesource[/URL].com/platform/manifest<br />
```
Won't that download like, A TON of code that isn't necessary?


----------



## JBirdVegas (Jun 11, 2011)

Building aosp is tricky try cm9 first

My guess 4.0.2 will be tagged soon

Sent from my Galaxy Nexus using Tapatalk


----------



## patrick (Jul 25, 2011)

Am I still going to need to get the proprietary files? As in run the ./extract-files.sh script? Can it even be run since my phone is running stock 4.0.2?

Also, I was under the impression that both Nexi were the Tuna, and that the GSM was the Maguro and the Toro was the LTE. I guess it would make sense if it wasn't in the source yet, but will building for the Tuna give me a ROM compatible for both versions? Or should I hold off until there is support for the Toro?


----------



## EmericanX (Sep 24, 2011)

Toro source is available. Built today with the available propriety. Baseband unknown. Anyone wanna lend a helping hand ?

Sent from my Galaxy Nexus using Tapatalk


----------



## patrick (Jul 25, 2011)

lifebeginsfriday said:


> Toro source is available. Built today with the available propriety. Baseband unknown. Anyone wanna lend a helping hand ?
> 
> Sent from my Galaxy Nexus using Tapatalk


I did the same thing, and then I found my answer here: http://groups.google.com/group/android-building/msg/255b275806510204

I'm pretty sure Qualcomm made the 4G radios, and I guess that we are just waiting for Google to make a deal with them so that they can package them for AOSP.


----------



## EmericanX (Sep 24, 2011)

Ahh... well let's hope they get to them this week. Without radio its a no Tom.. but is it just me or does that build fly! The boot animation is barely existent. Lol

Sent from my Galaxy Nexus using Tapatalk


----------



## patrick (Jul 25, 2011)

I actually haven't tried that, I read it while I was compiling... I heard it's definitely something that Google's proud of though, I can't wait until we DO have the binaries!


----------



## muksu (Apr 26, 2012)

Hi Patrick,
Sorry for the previous entry, i pressed by accident the enter key before finishing the text:

I have the same problem that you had, i mean

The android is built in my home directory "/home/muksu" instead of the specified "/home/muksu/WORKDIRECTORY"
Please, could you tell me how did you fix it?
Thank you.

This post is regarding to your previous post:
"
I don't know if this did what it should have done, because I got this output "repo initialized in /home/patrick" instead of what I was expecting, which was something along these lines: "repo initialized in /home/patrick/android/system." I made sure that I my working directory was still right, and it was still android/system. I don't know if that was right or not, but I assumed it was since I had literally copied and pasted the lines from the wiki
"


----------



## JBirdVegas (Jun 11, 2011)

Make the correct filer and move the hidden .git to the correct place or just cd to the correct directory and do another repo init in the correct folder then repo sync


----------



## Dreamboxuser (Mar 30, 2012)

When I try and make my build I get ALL_PREBUILT contains unexpected files and it gives me a list of files. I can't find where to remove them from the /build/target/product/core.mk. any suggestions?

Sent from my GT-S5360 using Tapatalk 2


----------



## doug piston (Jun 10, 2011)

Could you please post the full error. The more info you give the easier it will be to track it down.

Edit:: Someone should post a sticky on the amount of info needed to help people.


----------



## Dreamboxuser (Mar 30, 2012)

doug piston said:


> Could you please post the full error. The more info you give the easier it will be to track it down.
> 
> Edit:: Someone should post a sticky on the amount of info needed to help people.


True you are right I should have posted more info. I was planning to as I posted this from my phone. I did however solve the issue by deleting the external directory and resyncing.

Fyi for those missing packages the Synaptic Package Manager is awesome.

Sent from my GT-S5360 using Tapatalk 2


----------



## Dreamboxuser (Mar 30, 2012)

Resolved sorry.....sync problem

ok got the above issue resolved but now i'm pretty stuck now. I cant seem to find

```
<br />
make: *** No rule to make target `out/target/common/obj/APPS/com.replica.replicaisland_intermediates/classes.jar', needed by `out/target/common/obj/APPS/CtsOpenGlPerfTestCases_intermediates/classes-full-debug.jar'. Stop.
```
[Resolves as well]i'm curious though.... from what i have found replica island is a game about an android looking for a power source. I Cant find the game anywhere in the source and the only reference to it is in my error message.
I've done the following: make clean, make clobber added the game to /packages added a makefile, repo synced to the gummy sources. ÷Checked as many devices for something resembling anything to do with this file that I an missing. I just dunno where to find the rule to make that file or how to get around this error.


----------

