[GUIDE][Ubuntu] Compiling Android from Source

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Nope, not ready yet; although I'm sure they'll get to it before long.

Until then, I'm trying to figure out the camera, gps, and nfc binaries. Did you pull these from a 4.0.4 toro?

I would check out working roms and see what they did :).

My last bugs for my rom were those, but others had figured it out. That's the best thing I could "prescribe" sotospeak.
 

ttrevorr

New member
Nov 16, 2011
3
1
0
Visit site
i figured as much... but i guess my problem was just trying to find the right file. It wasnt obvious where the file was located. but i searched for it, found it, made the change and now I am compiling.

If you are getting an error on compile on Ubuntu 12.04
[out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/javalib.jar] Error 41
I dont know if this helps anyone else but you need to change the lines (starting at line number 227) in the file located
/proc/3175/cwd/external/guava/guava/src/com/google/common/collect/Maps.java
original
public static <C, K extends C, V> TreeMap<K, V> newTreeMap( @Nullable Comparator<C> comparator) {

with this
modified
public static <K, V> TreeMap<K, V> newTreeMap( @Nullable Comparator<? super K> comparator) {
 
  • Like
Reactions: dmmarck

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Hello!

First off, thank you for this great guide!

I've been able to compile AOSP JB for my GNex from source and install it. Everything works except the camera and gtalk (fc's).

The system I am compiling on is running Ubuntu 10.04, i've started over quite a few times now using this guide, and the result is the same.

Before I started compiling JB I was able to compile AOSP ICS from souce and installed on my GNex without any problems at all.

I have re-downloaded the drivers from google and still in the end I get the same result, is there something else that I am missing?
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Hello!

First off, thank you for this great guide!

I've been able to compile AOSP JB for my GNex from source and install it. Everything works except the camera and gtalk (fc's).

The system I am compiling on is running Ubuntu 10.04, i've started over quite a few times now using this guide, and the result is the same.

Before I started compiling JB I was able to compile AOSP ICS from souce and installed on my GNex without any problems at all.

I have re-downloaded the drivers from google and still in the end I get the same result, is there something else that I am missing?

Nope--those are the two issues that everyone runs into. I suggest checking out working roms--for example, Bugless Beast--to see how they get that stuff working. I presume there are a few files missing in our "stock" AOSP roms that they have (probably taken from ICS) in order to fill in the gaps.
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Nope--those are the two issues that everyone runs into. I suggest checking out working roms--for example, Bugless Beast--to see how they get that stuff working. I presume there are a few files missing in our "stock" AOSP roms that they have (probably taken from ICS) in order to fill in the gaps.

Thank you for the responce!

I did read something last night on the google forums somewhere that they were suggesting that you would take 3 files from an ICS build and put them into your JM build, it was:

- /vendor/etc/sirfgps.conf
- /vendor/lib/hw/gps.omap4.so
- /vendor/firmware/ducati-m3..bin

I have another pc that I used to build ICS on and had extracted the files from my GNex before flashing it per the ICS AOSP build guide, however two of those files are for the GPS, which for me in JB, I do not have any GPS problems.

The other problem is that I do not have the directorys on my JB pc as I do on my ICS pc, so I am kinda lost on that front. Any ideas?

Thanks again
 

letM3in

New member
Feb 24, 2011
4
1
0
Visit site
Google cannot distribute the GPS, NFC, and camera binaries for toro due to licensing issues.

It's strange that you say your GPS is working if you haven't acquired those binaries elsewhere. Have you verified this with GPS status or perhaps disabling wifi and checking to see if gmaps can find you?

From what I understand, you can get the camera and NFC binaries from a maguro 4.1 image, but the GPS binary must come from a ICS toro.
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Google cannot distribute the GPS, NFC, and camera binaries for toro due to licensing issues.

It's strange that you say your GPS is working if you haven't acquired those binaries elsewhere. Have you verified this with GPS status or perhaps disabling wifi and checking to see if gmaps can find you?

From what I understand, you can get the camera and NFC binaries from a maguro 4.1 image, but the GPS binary must come from a ICS toro.

I did check and gmaps is able to find me without wifi enabled, however the gps icon I am used to seeing at the top does not show up(maybe a bug?)

I know that the Vicious-JB-4.1.1-V1 rom worked perfectly, I didn't run into any issues like this, would I be able to grab the binaries from that and use them to compile mine? I am assuming I would have to re-compile after doing this.

Thanks
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Good Morning,

You guys were right, the gps drivers are not there in the AOSP for JB either.. I tried a couple of different apps to test the gps and it was a no go.

So i'm starting to get the impression that asking how one would get older drivers to work with an AOSP JB build is not something you do(some legal issue?), am I mistaken? I've been trying to get a better understanding on how to do this, trolling through forums and it just seems like there is nothing on how you could do this.

I have limited experience, but more than willing to learn, the only thing I have seen is "take the drivers you need from ICS". What I would like to figure out is I have the drivers (taken from my phone running ICS before I put JB on it using extract-files.sh) The drivers have to be copied to somethere, but then isn't there something else besides compiling you need to do?

I would appreciate any direction on this.
 

letM3in

New member
Feb 24, 2011
4
1
0
Visit site
Good Morning,

You guys were right, the gps drivers are not there in the AOSP for JB either.. I tried a couple of different apps to test the gps and it was a no go.

So i'm starting to get the impression that asking how one would get older drivers to work with an AOSP JB build is not something you do(some legal issue?), am I mistaken? I've been trying to get a better understanding on how to do this, trolling through forums and it just seems like there is nothing on how you could do this.

I have limited experience, but more than willing to learn, the only thing I have seen is "take the drivers you need from ICS". What I would like to figure out is I have the drivers (taken from my phone running ICS before I put JB on it using extract-files.sh) The drivers have to be copied to somethere, but then isn't there something else besides compiling you need to do?

I would appreciate any direction on this.

I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so

Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.
 
  • Like
Reactions: dmmarck

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so

Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.

Could you not transfer those over to the end product in the system/lib and other areas?

Great work BTW, thank you :). It saves a lot of time--I was preparing to compare roms back to back to see what is what.
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so

Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.

I just wanted to say THANK YOU! It took me a while to find all the files and the right versions, but I am finally building from source now and hopefully within the next hour or so I will find out if I did it correctly.

This is really interesting stuff,can't wait to learn more...

Thanks again!
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Just an update, IT WORKS!!! Okay, so I got all excited and so far have only tested the camera, which now works! But in all my excitement forgot one little detail,, GAPPS, so is using Kejar gapps good for a stock AOSP build, or should I get the latest one from goo.im?
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Just an update, IT WORKS!!! Okay, so I got all excited and so far have only tested the camera, which now works! But in all my excitement forgot one little detail,, GAPPS, so is using Kejar gapps good for a stock AOSP build, or should I get the latest one from goo.im?

Try looking for the one on goo that has aokp in it. That has jb gapps. I believe it was from 7/26.

Also, congrats!

Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site
Try looking for the one on goo that has aokp in it. That has jb gapps. I believe it was from 7/26.

Also, congrats!

Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2

Thanks! Well I just got through checking out the other things that weren't working, so the Camera and gps are now working fine, I don't have any way to test NFC(I have never used it anyways).
 

javroch

Well-known member
Jun 29, 2010
130
17
0
Visit site
I was in the same boat last week. Here's what I did (roughly -- I don't have my build machine in front of me right now). Hope it helps.

I performed a full build and then wrote a script that checks each blob listed under device/samsung/toro/proprietary-blobs.txt with what was output by the build under system/out. That identified six missing files:
Code:
/system/app/CellBroadcastReceiver.apk
/system/bin/fRom
/system/vendor/etc/sirfgps.conf
/system/vendor/firmware/ducati-m3.bin
/system/vendor/firmware/libpn544_fw.so
/system/vendor/lib/hw/gps.omap4.so

Then the hunt began for these files... it's up to you to find them.

CellBroadcastReceiver.apk: I haven't had a chance to look into this one, so it's still missing. However, it is also missing from the other toro ROMs I've seen. My build seems to run fine without it.
fRom: is present under vendor/samsung/toro/proprietary/ but was being copied to the wrong location by the Android.mk file, so I corrected that.
sirfgps.conf: GPS. Get from toro 4.0.4 ROM.
ducati-m3.bin: Camera. Get from maguro 4.1 ROM.
libpn544_fw.so: NFC. Get from maguro 4.1 ROM.
gps.omap4.so: GPS. Get from toro 4.0.4 ROM.

Once you find the blobs you will need to create makefiles for them. Luckily, AOSP contains the skeleton makefiles for these under device/samsung/toro/self-extractors/. Create the necessary directories under vendor/ and copy these makefiles there along with blobs. I believe one of the makefiles under vendor/samsung/toro already looks for these makefiles and includes them if present.

Once you have everything setup it's time to make clobber and run another build. Re-check the files listed in proprietary-blobs.txt and ensure you have at least the 5/6 that I mentioned. If you're satisfied with the results, try flashing it.

Good luck.

CellBroadcastReceiver.apk is actually included in the factory binaries, the scripts just aren't copying it to the device. Similar to how fRom was in the factory binaries, but being copied to the wrong location. Not that I know what it does, or had issue without it, but I added it in by adding it to the list of packages in vendor/samsung/toro/device-partial.mk and by adding a section for it in vendor/samsung/toro/proprietary/Android.mk

UPDATE: Nevermind, it causes builds to fail if you do that.
 
Last edited:

triptosyll

Well-known member
Jan 7, 2012
48
1
0
Visit site
first off thanks for this guide! makes me feel a little like superman! haha
my question is, i wanna build the ics branch for my phone, as its too old to handle jb, and im wondering what i need to do to tell the computer to build that branch, and not jb.
 

thx123a

Member
Jul 26, 2012
13
1
0
Visit site

Members online

Forum statistics

Threads
943,011
Messages
6,916,883
Members
3,158,774
Latest member
Xd3dp1gX