[GUIDE][Ubuntu] Compiling Android from Source

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Note: had to change "$ source build/envsetup.sh" to "# source build/envsetup.sh" because of "permission denied"

Also, ended up having to install sun java 6 from "bin", "jre", and "jdk" .deb packages pulled from a website called "debian snapshots".

Yeah the sun part is the trickiest. Weird you had to use a pound sign with the environment setup command; although I used the "." command myself.

Ok, thanks!

Edit:
So I ended up with out/product/toro/full_toro-ota-eng.root.zip, 120mb. Is that the file I'm looking for?

Yup :). How's it working?
 

khalid.hart

New member
Jan 17, 2011
3
0
0
Visit site
First things first, thanks for the awesome guide.

When I use either of the make commands I get an error stating that I am "attempting to build with the incorrect version of java." It states that my version is 1.6.0_24 and the correct version is just 1.6. I followed the guide 100% and just copied and pasted the commands as you wrote them. Any ideas on the error? I am running Ubuntu 12.04 64-bit.

Thanks
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Check this link if you're having java issues. Have you tried installing it again?

For whatever reason getting the JDK is the hardest part of this procedure. The open one should work, but right now the AOSP supplied method is...wonky.

http://www.gaggl.com/2012/04/installing-java6-jdk-on-ubuntu-12-04/

I'd suggest reinstalling it and seeing if that helps. You synced with source right, that went by smoothly?

I'll look up your specific issue a bit later, but unfortunately I don't have personal experience with that problem :(.

EDIT: check this link as well for troubleshooting/getting around Java 6/JDK issues!

http://ronubo.blogspot.com/2012/04/building-aosp-with-ubuntu-1204.html

Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
 
Last edited:
  • Like
Reactions: 2defmouze

nmyeti

Well-known member
May 22, 2010
134
6
0
Visit site
Thanks for the guide!

I am using this guide and trying to build for the nexus 7 (grouper) with the nexus 7 drivers instead of the tuna drivers listed in this post. When I get to the lunch command and make my selection, i get a bunch of permission denied errors. I re-did this section of the guide, but did a sudo su command first to see if that cured the issues and it appears that it has. Android is building at the moment, so we'll see if it works.

Any ideas why i would have to be logged in as full root?
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
Thanks for the guide!

I am using this guide and trying to build for the nexus 7 (grouper) with the nexus 7 drivers instead of the tuna drivers listed in this post. When I get to the lunch command and make my selection, i get a bunch of permission denied errors. I re-did this section of the guide, but did a sudo su command first to see if that cured the issues and it appears that it has. Android is building at the moment, so we'll see if it works.

Any ideas why i would have to be logged in as full root?

That's a good question. On my first build (I've done two with two different source compiles), I also had permissions problems with the drivers. I manually changed the owner and the permissions in terminal to each and every file/folder and that seemed to solve it. "Sudo" itself did not and it really left me perplexed...

...yet, on the second compile after the second source was downloaded (I deleted everything from the first go 'round to essentially do it again), all was fine.

Funky, eh?
 

nmyeti

Well-known member
May 22, 2010
134
6
0
Visit site
yeah, that is strange. I've had file permission issues with Ubuntu building before. Sudo su seems to fix it, but it would be nice not to have to resort to a sledgehammer
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
yeah, that is strange. I've had file permission issues with Ubuntu building before. Sudo su seems to fix it, but it would be nice not to have to resort to a sledgehammer

I agree; a lot of this process, for better for worse, takes some ingenuity. For example, on the second compile I ran into about ~6 fetch errors when syncing source. The first one, which was done minutes after JBQ gave the go ahead? None.
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
UPDATE:

I updated the second post with git tag verification. Some guides have this, some don't, but I think it's a good step and I have decided to include it for those who want it.
 

cj100570

Spoken Word?
Nov 12, 2009
417
24
0
Visit site
I'm running into an permission denied issue. Any ideas? I'm also not seeing an option for a toro build.


cj@Chimera:~/WORKING_DIRECTORY$ lunch

You're building on Linux

Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. mini_armv7a_neon-userdebug
6. mini_armv7a-userdebug
7. full_wingray-userdebug
8. full_crespo-userdebug
9. full_maguro-userdebug
10. full_panda-userdebug

Which would you like? [full-eng] 9
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied

find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.1
TARGET_PRODUCT=full_maguro
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-26-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JRO03C
OUT_DIR=out
============================================
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
 

dmmarck

Retired Moderator
Dec 28, 2011
8,349
2,594
0
Visit site
I'm running into an permission denied issue. Any ideas? I'm also not seeing an option for a toro build.


cj@Chimera:~/WORKING_DIRECTORY$ lunch

You're building on Linux

Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. full_grouper-userdebug
5. mini_armv7a_neon-userdebug
6. mini_armv7a-userdebug
7. full_wingray-userdebug
8. full_crespo-userdebug
9. full_maguro-userdebug
10. full_panda-userdebug

Which would you like? [full-eng] 9
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied

find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied
find: `vendor': Permission denied
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.1.1
TARGET_PRODUCT=full_maguro
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-26-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JRO03C
OUT_DIR=out
============================================
make: stat: vendor/samsung/tuna/BoardConfigVendor.mk: Permission denied
make: stat: vendor/samsung/maguro/BoardConfigVendor.mk: Permission denied

I had that happen on my first compile--try changing the permissions of the vendor folder or try using "sudo su."

I solved it by using the long way--I changed ownership to everything by typing this in:

$ sudo chown dmmarck

(Use your username, not mine obviously lol)

(Make sure to have a space after your username/before the file/folder!)

And then after typing that, I dragged and dropped each folder/file on each level of the /vendor folder. Thankfully, that worked. I'm sure there's a way to do it quicker and more efficiently (it was very late at night, so sue me :p), but that worked for me.

EDIT: I'm a dummy, you can do this as well and it should work (my apologies :))

sudo chown -R dmmarck /vendorfolderhere

You can also change permissions with chmod instead of chown.
 
Last edited:
  • Like
Reactions: 2defmouze

Andrew Ruffolo

Well-known member
Jan 5, 2010
3,567
172
0
Visit site
[YT]http://www.youtube.com/watch?v=d-_G0RP9J1U[/YT]

Here's my video how-to. Didn't go as in-depth as this tutorial (it rocks), but its at least a visual for those that may need something more like a class. I have other videos on my channel as well (shameless plug). Feel free to insert video wherever you like.
 

Channan

Keyboard Warrior
Mar 21, 2010
842
69
0
Visit site
2hick8z.gif


Dafuq did I just read?

I'd like to take this moment to thank all the people who do the hard work of building custom ROMs so I can just download a single file and select yes to install it.

Thank you for making my life easier.
30clslt.gif
 

Andrew Ruffolo

Well-known member
Jan 5, 2010
3,567
172
0
Visit site
  • Like
Reactions: Channan

Trending Posts

Forum statistics

Threads
943,008
Messages
6,916,864
Members
3,158,772
Latest member
Laila Nance