Welcome to the Android Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Page 1 of 13 1234 ... LastLast
Results 1 to 25 of 301
Like Tree92Likes
  1. Thread Author  Thread Author    #1  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default [GUIDE][Ubuntu] Compiling Android from Source

    [INFO]Table of Contents
    1. Creating the "Build Environment"
    2. Syncing with the Source
    3. Creating your "Rom"
    4. Troubleshooting/Fixes
    [/INFO]

    Android is known for its ability to be customized by the end user. The typical way to do this is to flash a rom, which is essentially an "image" of the operating system plus other goodies that can give you entirely new look and a host of neat features to play with. But rom developers usually start at one point--"source."

    Source is essentially the raw code of Android. Let's put it this way--if you want to make an omelete, you're going to have get some eggs, cheese, spices, etc. Those ingredients are source. You put those ingredients together and you get an omelet, or at least get you something close enough. Here's how we get to that point.

    [WARN]This guide is primarily for users of Ubuntu, particularly 64 bit. I will frequently use and mention several other guides that can help you if you are on other operating systems, particularly Mac OSX (check out the AOSP one first). If you are unfamiliar with Ubuntu/Linux, I advise you to read up a bit and become at least "moderately" familiar with how it works, particularly terminal and sudo/"root" permission commands.

    Further, make sure you have enough space and adequate hardware to do this. I've seen recommendations of having at least a dualcore machine, with 2+ gb of RAM and at least 25-30 gigs of harddrive space free. Builds take up quite a lot of space, so you want to play it safe![/WARN]

    The first step in compiling Android is to create what's called a "build environment." Essentially, you're installing a bunch of software that will enable you to both sync up ("download") the source and to actually put together either flashable images or a flashable zip.

    #1 Install the Android SDK

    It is always best to have the Android SDK installed on your machine. Go here to download the SDK package, extract it, and put it in your "home" directory. Be sure to follow the instructions and ensure everything is working properly. It's also good to triple-check that fastboot and ADB are both functional and usable.

    [TIP]A great guide to installing the SDK and other neat Android goodies can be found here. I personally used it and it was awesome.[/TIP].

    #2 Install the Java Development Kit (JDK/Java 6)

    Now let's get to to installing more important stuff. The first thing on the list is the JDK (Java 6), since that's the JDK required for compiling Gingerbread and all of the Android versions after. Obviously most of you will want to compile Jelly Bean, so this is crucial.

    The recommended way to do this is to open up the terminal and type in these commands. Note, you can copy and paste the command (copy from "sudo" until the end) and make sure hit enter after each command!

    $ sudo add-apt-repository "deb Index of / lucid partner"
    $ sudo apt-get update
    $ sudo apt-get install sun-java6-jdk
    If for some reasons that does not work, there are some alternatives, notably this:

    $ sudo apt-get install openjdk-6-jdk
    If that does not work, and it may not due to licensing and support issues, either (1) Google search the issue by copying/pasting the command line error into Google (wrap it in quotes!), or (2) try to search for other alternatives repositories to add. We have several options in the fourth post (troubleshooting/fixes) as well as a few that have been mentioned throughout this guide. This is a bit of a wonky step, so don't let it get you down! Not your fault, just blame Google/Sun .

    #3 Install Python

    Once the JDK is installed, you need to install Python. In some versions of Ubuntu (and I believe 12.04 is one of those versions, Python is already installed. Still, it doesn't hurt to double check!

    Simply enter this command:

    $ sudo apt-get install python
    #4 Install Git

    Git is one of the coolest, yet most confusing things, about Android/Linux. Think of it this way--it's a place where all of the revisions to the code go to be approved and get incorporated so that you have a solid piece of working software.

    For git, enter this:

    $ sudo apt-get install git-core
    #5 Install the Required Packages

    Once the JDK, python, and git are installed, you're ready to start installing some more "specific" packages required to compile Android.

    If you're running Ubuntu (remember, 64 bit), and your version of Ubuntu is between 10.04 and 11.10, simply input this entire thing and hit enter:

    $ 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 xsltproc
    If you're on Ubuntu 10.10, also input this:

    $ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
    If you're on Ubuntu 11.10, you want to input this:

    $ sudo apt-get install libx11-dev:i386
    You may also need this if you're on 11.10, so I'd recommend installing it anyway (and this may be duplicative, but don't worry, Ubuntu's smarter than she may sometime act!)

    $ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
    If you're like me and you're on Ubuntu 12.04 (again, 64 bit!), there are two warnings that Google/Android gives us: (1) building on 12.04 is experimental, and (2) it's not guaranteed to work for any branch of the repository other than the master branch.

    That being said, here are your packages:

    $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
    zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
    libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
    libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
    python-markdown libxml2-utils xsltproc zlib1g-dev:i386
    And don't forget this...

    $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
    #6 Configure USB Access

    This step is important because it will enable to access pretty much any Android device by using your USB port (and your USB cable). First, let's bring up the file you'll need to "edit":

    $ gksudo gedit /etc/udev/rules.d/51-android.rules
    This will open up a text file. In that file, simply copy and paste this big ole list right into it, save it, and then close the file.

    #Acer
    SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"

    #ASUS
    SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"

    #Dell
    SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"

    #Foxconn
    SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"

    #Garmin-Asus
    SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"

    #Google
    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"

    #HTC
    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"

    #Huawei
    SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"

    #K-Touch
    SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"

    #KT Tech
    SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"

    #Kyocera
    SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"

    #Lenevo
    SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"

    #LG
    SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"

    #Motorola
    SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

    #NEC
    SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"

    #Nook
    SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"

    #Nvidia
    SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"

    #OTGV
    SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"

    #Pantech
    SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"

    #Philips
    SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"

    #PMC-Sierra
    SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"

    #Qualcomm
    SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"

    #SK Telesys
    SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"

    #Samsung
    SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"

    #Sharp
    SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"

    #Sony Ericsson
    SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"

    #Toshiba
    SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"

    #ZTE
    SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
    Remember, be sure to save it and close it. Once closed, enter this command:

    $ sudo chmod a+r /etc/udev/rules.d/51-android.rules
    Now your build environment is complete and you're ready to download the repo/source and get crackin'. If you have any issues, I suggest checking out my sources as well as simply asking me/our community or Googling the issue. The best way to search for an error (that I have found) is to simply copy and paste the "error" from your terminal into Google and seeing what comes out. Adding in extra terms like "Android" "source" "compile" and "build" may also help.

    [NOTE]I'd like to give credit where it's due, and that's mainly these following five resources--Android Open Source Project, XDA Developer dastin1015, NPRussell, futurecrue, and droseum20. Thanks to all of these great guides and devs![/NOTE]
    Last edited by dmmarck; 07-16-2012 at 11:39 AM.
    Thanked by 54:
    + Show/Hide list of the thanked
  2. Thread Author  Thread Author    #2  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE] Compiling Android from Source for the Galaxy Nexus

    The next "big" step once your build environment is "created" (installed) is to download the Android source code. This isn't necessarily difficult, it's just time consuming, sometimes taking 3 hours for everything to download. I recommend doing this when you know you have enough time to "babysit" it, because errors may creep up and you'll want to address those ASAP.

    #1 Making the Repo

    First, we want to make sure that you have a path for the repo to install to. Input these commands in terminal, just like you did with the prior steps.

    $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    Now, once that's finished, you download the repo script and ensure that it works (i.e. it's executable). Use these commands:

    $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo
    [NOTE]Please make sure you copy and paste the whole thing. Ignore the fact that the link is live on here, treat it as if it's simply plain old text.[/NOTE]

    #2 Create your "Working Directory"

    Once the above is finished, you'll want to create the directory that everything is going to download to and where your "rom" will eventually pop out after it is built.

    First, enter this command.

    $ mkdir WORKING_DIRECTORY
    [TIP]Note that you can make your "WORKING_DIRECTORY" whatever name you please. Some suggestions include "JB_SOURCE," "SOURCE_DIRECTORY," "ANDROID_AWESOME," etc. Simply substitute your chosen name for "WORKING_DIRECTORY" in the above command.[/TIP]

    Then, you'll want to "change directory" to that directory you just created. Remember, if your directory is something other than "WORKING_DIRECTORY," use that name!

    Simply input this command to change directory (go to that directory):

    $ cd WORKING_DIRECTORY
    #3 Downloading the Source - The Long Haul

    [NOTE]This step may take forever or it may take just an hour. Regardless, schedule your time appropriately![/NOTE]

    Generally, you'll have two options--downloading the "master" branch of Android (it's basically everything), or downloading a specific branch. Now if you're on Ubuntu 12.04 like I am, remember that warning Google gave us--only the master directory is guaranteed!

    To sync with/install the master source directory, input the following command:

    If you wish to download a specific directory, say for this purpose Jelly Bean 4.1.1, use the following command:

    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1
    Now, a prompt will come up asking for your real name and your address. Please use your real name and your real email address. If you ever take this hobby further and wish to submit code revisions to the AOSP, it would behoove you to stand by your name (so to speak).

    [TIP]If you have already done a repo init and simply want Jelly Bean 4.1.1, try using these commands instead:

    $ repo init -b android-4.1.1_r1
    $ repo sync
    [/TIP]

    Now, it's time to actually sync up with the source and grab a snack, a meal, or The Lord of the Rings Extended Blu-Ray Trilogy. Input the following command:

    $ repo sync
    Sit back and relax and wait. If a fetch error comes up, I have found that the best way to get around it is to simply enter:

    $ repo sync -f
    I will be troubleshooting other errors a bit later on.

    #4 Verifying Git


    Another good thing to do is verify the git tags. This is fairly simple.

    First, enter this command:

    $ gpg --import
    Then, without closing a window or terminal, copy and paste the following into the terminal window.

    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.2.2 (GNU/Linux)

    mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
    lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
    8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
    u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
    wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
    /HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
    jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
    MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
    b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
    aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
    cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
    gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
    2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
    QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
    hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
    C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
    LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
    OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
    pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
    KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
    N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
    vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
    G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
    hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
    EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
    =Wi5D
    -----END PGP PUBLIC KEY BLOCK-----
    Hit control + D after you pasted and all is done. If you want to verify individual tags, simply use this command:

    $ git tag -v TAG_NAME
    Once finished, you will have all of Android on your harddrive. For me, that totalled 15.1 gigs, so like I said, be sure you have space! (...and time) (...or a TARDIS?)

    [NOTE]I'd like to give credit where it's due, and that's mainly these following five resources--Android Open Source Project, XDA Developer dastin1015, NPRussell, futurecrue, and droseum20. Thanks to all of these great guides and devs![/NOTE]
    Last edited by dmmarck; 07-14-2012 at 05:58 PM.
    Thanked by 28:
    + Show/Hide list of the thanked
  3. Thread Author  Thread Author    #3  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE] Compiling Android from Source for the Galaxy Nexus

    Once you have that shiny, massive directory full of source code, it's time for you to do something with it--build Android. This is another "simple" process that requires a lot of time (an hour or two hours is not unreasonable).

    #1 Download and Extract Proprietary Drivers

    A neat thing about the recent Jelly Bean source drop is the inclusion (or reinclusion) of the Verizon GN into AOSP. Most of this is evidenced by the fact that proprietary binaries--binaries made without open source code but the "intellectual property" of another/a business--are now available. You will need these binaries to create a working and functional rom for your device.

    Generally, you can find all of the binaries and drivers for any AOSP Nexus device on this page.

    There are four binaries needed for the Verizon Galaxy Nexus in order to make a working Jelly Bean/JRO03C/4.1.1 build. The download links are available here:

    WiFi/Bluetooth courtesy of Broadcom
    Graphics courtesy of Imagination Technologies
    Orientation Sensor courtesy of Invensense
    CDMA/LTE courtesy of Samsung

    If those links are broken, please reference that main Nexus drivers page for the updated links.

    Now, download all of your required drivers and extract them to the "root" of your WORKING_DIRECTORY (or whatever directory name your imagination came up with). Simply unpack and drop it into that main folder.

    Now, you will see that you have files that look something like this--"extract-imgtech-toro.sh" (or some variation thereof). You will need to further extract them from that WORKING_DIRECTORY, and we do this in the terminal.

    First, make sure you're at your WORKING_DIRECTORY, so "change directory" or "cd" to there if you're not.

    $ cd WORKING_DIRECTORY
    Then, you have two options. First, you can run:

    $ sh nameofthebinaryfileyouneedtoextract.sh
    Or you can type in "sh" and then drop and "drop" the file into terminal. It'll do the same thing. Now, with either option, you will have to accept to terms. Each will take you to a fairly length contract. My suggestion? Read it (I have to say that). My other suggestion? Mash the enter/return key but be careful when you see "Miscellaneous" terms pop up. Then hit enter very carefully, waiting to see what comes next. Eventually you'll have a line that says something like "type I ACCEPT to agree to the terms." So, type:

    I ACCEPT
    Be sure to do that for each of your drivers, and now you're ready to proceed with the build.

    #2 Initialize your Build Environment

    Remember that build environment you installed in the first post? It's time to put it to work.

    Enter this command:

    $ source build/envsetup.sh
    You may also use this command (it does the same thing):

    $ . build/envsetup.sh
    #3 Choose your Device!

    In this step, you must tell your build environment where to go, what device to build for, and what type of build you want it to construct.

    First, you want to get to the device "target" selection by entering a simple "lunch" command:

    $ lunch
    Then, you can either pick from the numerical menu or input your device manually. We're going to be using "tuna" names here. If you're on GSM, you want to use "maguro." If you're on Verizon, you want to use "toro."

    The other big piece of this next command is which build type to choose. You have three options, however I prefer only one--userdebug.

    The three options are:

    1. user - limited access; suited for production
    2. userdebug - like "user" but with root access and debuggability; preferred for debugging
    3. eng - development configuration with additional debugging tools


    My suggestion? Pick userdebug, it's pretty much the standard. Now, let's say you want to build a full toro userdebug build. Here's what you enter:

    $ full_toro-userdebug
    If you want the same build but you have a GSM Nexus, enter this:

    $ full_maguro-userdebug
    #4 BUILD IT!

    Once you have selected your device and build type you have two "make" options; in other words, two different builds can be constructed. You can make a bunch of images that you can flash via fastboot or you can make a flashable zip that can be used in ClockworkMod Recovery or TWRP Recovery. I suggest the latter, but I'll give you the option for both.

    To make fastboot-able images, type in:

    $ make -j#
    See that # sign? You don't want to actually use "#," but rather, as a general rule of thumb, take your number of cores your process has (in my case, 4) and add 1 (in case you don't know threads and all that associated fantastic geeky hardware knowledge)--or 5 in my case.

    Thus, I used the following command:

    $ make -j5
    Now, you might be able to get away with more, you might not. All this does is utilizes "parallelism" to compute things (i.e. build your rom) a bit faster. Some even use "-j1," professing its stability and low risk because everything is done with a single thread. The choice is yours, but realize that the higher the number, the faster the build.

    To make a flashable zip, input the following:

    $ make -j# otapackage
    Now sit back, throw on Dances With Wolves, and wait for your images or your zip to pop out. Once finished, it will be located in the "out" folder within your WORKING_DIRECTORY. I suggest copying and pasting the completed build to another folder or directory so you don't accidentally screw something up when you're tinkering/hacking.

    #5 Hack it and flash it!

    The last step can be either the most fun or the most aggravating, depending on your interest level and skill-set. For me, it is the latter.

    When your build pops out, in theory you can simply flash it and give it a test run. If it's a zip, you can do this like any other rom zip and flash it in recovery after making a nandroid/backup and doing a COMPLETE AND THOROUGH WIPE. If you chose the fastboot-able images route, you can simply cd/change directory to the images folder and then do the following:

    First, connect your phone to your computer via a usb cable and put your device into "bootloader." You can do this manually by powering down then, once off, simultaneously holding down the VOLUME UP, VOLUME DOWN, and POWER buttons. Or you can be clever, turn on USB Debugging in developer options and enter the command:

    $ adb reboot bootloader
    (If for some reason you don't have permission to do that, make sure you have the ADB drivers setup--which you should--and put "sudo" before that command).

    Then, once in "fastboot mode" (you'll see that in red), enter the following:

    $ sudo fastboot flashall -w
    The "-w" will do some wiping (data, I believe), so be sure to back your stuff up before you go this route.

    HOWEVER, flashing it this soon precludes a lot of things and using Google services is one of them. If you want to sign in, use gmail, use your apps, etc., you'll need to find a separate package of Google Applications--GAPPs--to flash as well. For Verizon Nexus users, this has been particularly frustrating because not every GAPPs package has worked. I suggest using whatever GAPPs package has worked for you (on Jelly Bean) in the past, or navigating through our rooting/roms subforum and finding roms with confirmed, working GAPPs packages. You flash this package as you would normally--immediately after the rom.

    From here, you can tinker with your rom, changing things like the build name, speed, adding different tweaks here and there, etc. Unfortunately, I have neither the talent or the knowledge to guide you onward. However, be rest assured, if you followed this guide (and the credited guides) you will have your very own, source-built rom, that you poured sweat, tears, and an exceptional amount of time and keystrokes into.

    Congratulations .


    [NOTE]I'd like to give credit where it's due, and that's mainly these following five resources--Android Open Source Project, XDA Developer dastin1015, NPRussell, futurecrue, and droseum20. Thanks to all of these great guides and devs![/NOTE]
    Last edited by dmmarck; 07-15-2012 at 02:08 AM.
    Thanked by 27:
    + Show/Hide list of the thanked
  4. Thread Author  Thread Author    #4  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE] Compiling Android from Source for the Galaxy Nexus

    I will be putting in common questions/problems once they arise. For now, please reference the credited guides for any immediate support, or simply post up in here for help .

    Fixes/Tricks

    Java6/JDK Issues:

    Java6 sometimes does not play nice, even with the AOSP-given commands to get it. Here are some resources that may help you out in resolving any Java issues, may it be installation or making sure OpenJava works.

    [TIP]For installing the JDK ==>


    For any read/version errors (thanks khalid!) ==>


    A version error looks like this:

    Your version is: java version "1.6.0_24".
    The correct version is: Java SE 1.6.
    [/TIP]

    "Make"/find: 'src' Errors

    To solve this, you can try updating your dependencies, or you can try this fix. You'll want to install this patch. Also see this post. Thanks ancorare and ewinkley!



    Compiling CyanogenMod

    Thanks to 2defmouze for the hat tip!
    http://www.omgubuntu.co.uk/2012/05/g...ool-for-ubuntu

    [NOTE]I'd like to give credit where it's due, and that's mainly these following five resources--Android Open Source Project, XDA Developer dastin1015, NPRussell, futurecrue, and droseum20. Thanks to all of these great guides and devs![/NOTE]
    Last edited by dmmarck; 07-16-2012 at 07:13 PM.
    Thanked by 12:
    + Show/Hide list of the thanked
  5. Thread Author  Thread Author    #5  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Feel free to post up in here with questions/comments!

    - D
  6. #6  
    2defmouze's Avatar

    Posts
    5,825 Posts
    Global Posts
    5,846 Global Posts
    ROM
    AOKP

    Default

    Quote Originally Posted by dmmarck View Post
    Feel free to post up in here with questions/comments!

    - D
    Comment: You da man!

    Sent from my Galaxy Nexus using Tapatalk 2
    Thanked by:
  7. #7  
    cj100570's Avatar
    Spoken Word

    Posts
    395 Posts
    Global Posts
    436 Global Posts
    ROM
    Jelly Bean

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    You promised and you delivered. I love you bro!
    It is better to be pissed off than to be pissed on!
    Thanked by:
  8. #8  
    wildman9904's Avatar

    Posts
    105 Posts
    Global Posts
    106 Global Posts
    ROM
    What day of the week is i

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Wow. Simplistic. This is beautiful. I tried to read what I needed to do on AOSP site, and my eyes bled. This, once I get linux up, actually makes me think I might be able to do something. Thank you.
    Thanked by:
    dmmarck likes this.
  9. Thread Author  Thread Author    #9  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    It's very simple, although if something goes awry it make took some improvisation. I essentially did it twice (aside from building the environment), so I got to run into a load of issues. I'll be adding some tricks to the troubleshooting section, as well as some other links to help out.

    One thing I want to make clear though: this isn't necessarily complicated, it just takes time. But once you put in that time, there's nothing like seeing your name right there in the "About Phone." Trust me on that .
    Johnly likes this.
  10. #10  
    zero neck's Avatar
    The Ever-Living

    Posts
    5,090 Posts
    Global Posts
    5,097 Global Posts
    ROM
    KANG

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Slick. Need ubunto.


    * INCREDIBLE * MECHA * TORO * GROUPER * GALAXY S3 *
    * [TORO RADIOS] * [NEXUS WALLS] * [GROUPER GUIDE] * [CHATTER] *
  11. #11  
    auburngirl's Avatar

    Posts
    179 Posts
    ROM
    Jelly!

    Default

    Thanks! I agree that other walkthroughs I have read just made my head hurt. This one seems like something I can handle. It will keep my inner geek satisfied for a bit. Next up? How to get started building apps. I know there was something about that a bit back.

    For anyone looking to put Ubuntu on your Windows machine...

    https://help.ubuntu.com/community/HowtoPartition

    Sent from my ASUS Transformer Pad TF300T
    Last edited by auburngirl; 07-13-2012 at 09:05 PM.
    dmmarck likes this.
  12. #12  
    auburngirl's Avatar

    Posts
    179 Posts
    ROM
    Jelly!

    Default

    Sticky please!

    Sent from my ASUS Transformer Pad TF300T
    dmmarck likes this.
  13. Thread Author  Thread Author    #13  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Quote Originally Posted by auburngirl View Post
    Thanks! I agree that other walkthroughs I have read just made my head hurt. This one seems like something I can handle. It will keep my inner geek satisfied for a bit. Next up? How to get started building apps. I know there was something about that a bit back.

    For anyone looking to put Ubuntu on your Windows machine...

    https://help.ubuntu.com/community/HowtoPartition

    Sent from my ASUS Transformer Pad TF300T
    Thanks so much! Please let me know if you have any questions. It can be a bit tricky, but it's certainly doable .
  14. #14  
    CA1NE's Avatar

    Posts
    98 Posts
    ROM
    Running the latest Bugles

    Default

    What's ubuntu?

    Sent from my Galaxy Nexus using Android Central Forums
  15. Thread Author  Thread Author    #15  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Quote Originally Posted by CA1NE View Post
    What's ubuntu?

    Sent from my Galaxy Nexus using Android Central Forums
    It's a variation on the Linux operating system (the same one that's the "basis" for Android) that's used on computers, laptops, etc. Often Linux variations are called "distributions."
    Thanked by 3:
    flyinj54 likes this.
  16. #16  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    /WORKING_DIRECTORY: should that go in /~ or /home or what?
    (in my case I have /home mounted to a spinning hdd with / mounted to 64 gb ssd)

    Do we need to flash a jelly bean bootloader?

    Will building this make a rom that will rewrite the recovery upon reboot like some factory images do?

    Can someone point to the best method for rooting this after installation?
  17. Thread Author  Thread Author    #17  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default

    Quote Originally Posted by dually View Post
    /WORKING_DIRECTORY: should that go in /~ or /home or what?
    (in my case I have /home mounted to a spinning hdd with / mounted to 64 gb ssd)

    Do we need to flash a jelly bean bootloader?

    Will building this make a rom that will rewrite the recovery upon reboot like some factory images do?

    Can someone point to the best method for rooting this after installation?
    Mine is in my home directory. You can really put in anywhere so long as you cd to it, although home directory is usually the standard place. I've seen and know of folks with different partitions and such for it, but that's a bit outside the scope of this guide.

    No, you do not need to flash or use Jelly Bean bootloader but I do use it myself. It's recommended right now in most circles (please see the JB threads for more JB specific discussion), but I'd hesitate to use it if you plan on going back to ICS at any point.

    Yes, it will replace recovery. Simply remove the recovery folder and two lines of code in the updater script that mention recovery, save, and it will not. Also, IIRC, there is also a file you need to remove or rename in /system to make a custom recovery stick. One of the credited guides mention the post compilation stuff with far more detail or expertise than I can, so I suggest browsing those as well. Alternatively, you may fastboot the custom recovery back.

    Rooting is fairly straight forward - simply flash the appropriate superuser zip. If you want to make it stick and flashable by others, open up the superuser zip and take the app and place it into /system/app and take the binary and place it in /system/xbin. I prefer to rename the old su binary to "su old".

    I will add a bit more explanation to the post rooting stuff after I go along and figure more out on my own. It's fun but tricky and it makes me appreciate the hard work that our devs do.

    Also, thank God for SwiftKey.

    Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
    Thanked by:
  18. #18  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    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".
    Thanked by:
  19. #19  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    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?
    Last edited by dually; 07-14-2012 at 03:24 AM.
  20. #20  
    Promoman89's Avatar

    Posts
    125 Posts
    Global Posts
    127 Global Posts
    ROM
    JellyBro I Trinity

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    man this is a nice guide. i'm going to have to boot over in to ubuntu and give this a shot...
    Thanked by:
  21. #21  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    thanks! i needed something to do on a rainy saturday morning
    Nexus 4 / Nexus 7 / Transformer Prime
    @digitalslacker
    +digitalslacker
    dmmarck likes this.
  22. Thread Author  Thread Author    #22  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    Quote Originally Posted by dually View Post
    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.

    Quote Originally Posted by dually View Post
    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?
  23. #23  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    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
  24. Thread Author  Thread Author    #24  
    dmmarck's Avatar
    Retired Moderator

    Posts
    10,929 Posts
    Global Posts
    10,930 Global Posts
    ROM
    What do you think?

    Default

    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/install...-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/b...untu-1204.html

    Sent from my Galaxy Nexus using Xparent Cyan Tapatalk 2
    Last edited by dmmarck; 07-14-2012 at 03:01 PM.
    Thanked by:
    2defmouze likes this.
  25. #25  

    Default Re: [GUIDE][Ubuntu] Compiling Android from Source

    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?
Page 1 of 13 1234 ... LastLast

Posting Permissions