[Tutorial] Compile JB on Ubuntu

Search This thread

cbucz24

Senior Member
Jan 31, 2011
2,757
2,897
Central Florida
After successfully building 4.2.1 CM for my device(I9001) it didn't boot. It got stuck on the kernel splash screen. My guess is that there is some changes I need to make to the ramdisk but I am not sure what to do as even after adding some changes all I got was a black screen after the splash. Any help on this? Thanks.

You at least need to learn about logcat, make it your friend.
Power the device on, and start the log, it will show you what its getting stuck on.


Sent from my PC36100 using Tapatalk 2
 

CptanPanic

Senior Member
Jun 15, 2011
193
66
Is there a way to build just a certain app? For example I just want to rebuild NfcNci.apk?

Sent from my Nexus 4 using Tapatalk 2
 

Kayant

Senior Member
Jul 14, 2011
1,861
4,150
Is there a way to build just a certain app? For example I just want to rebuild NfcNci.apk?

Sent from my Nexus 4 using Tapatalk 2

If you have already build the rom then you can use the mmm command. For example I make changes to in settings and just want to rebuild settings it will be mmm packages/apps/Settings.
 

Xistance

Senior Member
Dec 20, 2011
1,002
3,738
You at least need to learn about logcat, make it your friend.
Power the device on, and start the log, it will show you what its getting stuck on.


Sent from my PC36100 using Tapatalk 2

I know at least that much. Logcat, ddms/android monitor, none of them work.

Sent from my GT-I9001 using xda premium
 

manuel100

Senior Member
Nov 19, 2011
129
30
ROME
anyone knows how to fix com.android.phone.PhoneApp fc? (just built android 4.1.2, paranoidandroid 2.99) here the trouble piece extracted from logcat:

Code:
E/AndroidRuntime( 2510): FATAL EXCEPTION: main

E/AndroidRuntime( 2510): java.lang.RuntimeException: Unable to create application com.android.phone.PhoneApp: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.android.internal.telephony.SamsungMSMRIL

E/AndroidRuntime( 2510): at android.app.ActivityThread.handleBindApplication(A ctivityThread.java:4384)

E/AndroidRuntime( 2510): at android.app.ActivityThread.access$1300(ActivityThr ead.java:145)

E/AndroidRuntime( 2510): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1271)

E/AndroidRuntime( 2510): at android.os.Handler.dispatchMessage(Handler.java:99 )

E/AndroidRuntime( 2510): at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime( 2510): at android.app.ActivityThread.main(ActivityThread.jav a:4978)

E/AndroidRuntime( 2510): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 2510): at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:791)

E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:558)

E/AndroidRuntime( 2510): at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime( 2510): Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.android.internal.telephony.SamsungMSMRIL

E/AndroidRuntime( 2510): at com.android.internal.telephony.PhoneFactory.makeDe faultPhone(PhoneFactory.java:155)

E/AndroidRuntime( 2510): at com.android.internal.telephony.PhoneFactory.makeDe faultPhones(PhoneFactory.java:59)

E/AndroidRuntime( 2510): at com.android.phone.PhoneApp.onCreate(PhoneApp.java: 470)

E/AndroidRuntime( 2510): at android.app.Instrumentation.callApplicationOnCreat e(Instrumentation.java:999)

E/AndroidRuntime( 2510): at android.app.ActivityThread.handleBindApplication(A ctivityThread.java:4381)

E/AndroidRuntime( 2510): ... 10 more

E/AndroidRuntime( 2510): Caused by: java.lang.ClassNotFoundException: com.android.internal.telephony.SamsungMSMRIL

E/AndroidRuntime( 2510): at java.lang.Class.classForName(Native Method)

E/AndroidRuntime( 2510): at java.lang.Class.forName(Class.java:217)

E/AndroidRuntime( 2510): at java.lang.Class.forName(Class.java:172)

E/AndroidRuntime( 2510): at com.android.internal.telephony.PhoneFactory.makeDe faultPhone(PhoneFactory.java:148)

E/AndroidRuntime( 2510): ... 14 more

E/AndroidRuntime( 2510): Caused by: java.lang.NoClassDefFoundError: com/android/internal/telephony/SamsungMSMRIL

E/AndroidRuntime( 2510): ... 18 more

E/AndroidRuntime( 2510): Caused by: java.lang.ClassNotFoundException: com.android.internal.telephony.SamsungMSMRIL

E/AndroidRuntime( 2510): at dalvik.system.BaseDexClassLoader.findClass(BaseDex ClassLoader.java:61)

E/AndroidRuntime( 2510): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 01)

E/AndroidRuntime( 2510): at java.lang.ClassLoader.loadClass(ClassLoader.java:4 61)

E/AndroidRuntime( 2510): ... 18 more

W/ActivityManager( 1494): Process com.android.phone has crashed too many times: killing!

I/Process ( 2510): Sending signal. PID: 2510 SIG: 9

I/ActivityManager( 1494): Process com.android.phone (pid 2510) has died.

thanks
 

kevin130

Senior Member
Jul 13, 2012
391
58
West New York
frameworks/av/media/libstagefright/colorconversion/SoftwareRenderer.cpp: In member function 'void android::SoftwareRenderer::render(void const*, size_t, void*)':
frameworks/av/media/libstagefright/colorconversion/SoftwareRenderer.cpp:153:70: error: too few arguments to function
frameworks/av/media/libstagefright/colorconversion/SoftwareRenderer.cpp:158:56: error: 'struct ANativeWindow' has no member named 'lockBuffer'
frameworks/av/media/libstagefright/colorconversion/SoftwareRenderer.cpp:256:67: error: too few arguments to function
make: *** [/home/kevin/CyanogenMod10/out/target/product/shooter/obj/STATIC_LIBRARIES/libstagefright_color_conversion_intermediates/SoftwareRenderer.o] Error 1
make: *** Waiting for unfinished jobs....

uhhhh lol im kinda at a stump.
 
Last edited:

mg2195

Senior Member
Dec 5, 2011
2,983
2,572
29
RSM
Just out of curiosity...has anyone gotten the "android.com.phone.process has crashed" error? I may have gotten that error popup wrong..but its something like that. As soon as I boot the phone up with 4.2 it displays that error non-stop, as soon as you press OK to close it it will pop up again making it impossible to do anything...

I've been looking at log cats and if I can recall correctly it said something about a missing class with com.android.internal.telephony.iccprovider

I've tried many different things and nothing seems to work. There is a dev in my infuse section that has gotten past that bug, but he won't respond to ANY of my PMs...so if anyone has any info it would be great...I'll try and link the logcat later...

LOGCAT
Sent from my SGH-I997 using Tapatalk 2
 
Last edited:

triptosyll

Senior Member
Jan 7, 2012
659
459
Mineral Point
You're asking about building Cyanogenmod in an AOSP thread. Maybe try going to the CM website and asking them. Cyanogenmod is based off of AOSP but it isn't AOSP.

No, hes technically asking about building cm, in a compiling thread. The tiltle does not state aosp, and lots of people have asked for and recieved help for other sources here... :p

Sent from my Motorola Electrify using xda app-developers app

---------- Post added at 08:07 PM ---------- Previous post was at 08:03 PM ----------

I know at least that much. Logcat, ddms/android monitor, none of them work.

Sent from my GT-I9001 using xda premium

Then ur having kernel problems I believe. Logcat wont show anything before a certain point in the boot process. There is some kind of log that will tell u whats going on before that point, but cant remember what it is. Never had to use it.

Sent from my Motorola Electrify using xda app-developers app

---------- Post added at 08:09 PM ---------- Previous post was at 08:07 PM ----------

Just out of curiosity...has anyone gotten the "android.com.phone.process has crashed" error? I may have gotten that error popup wrong..but its something like that. As soon as I boot the phone up with 4.2 it displays that error non-stop, as soon as you press OK to close it it will pop up again making it impossible to do anything...

I've been looking at log cats and if I can recall correctly it said something about a missing class with com.android.internal.telephony.iccprovider

I've tried many different things and nothing seems to work. There is a dev in my infuse section that has gotten past that bug, but he won't respond to ANY of my PMs...so if anyone has any info it would be great...I'll try and link the logcat later...

LOGCAT
Sent from my SGH-I997 using Tapatalk 2

U know mg, I have had the problem before, but never attacked it from the debugging angle. Just changed my rom. The funny thing is, ive had it happen outta nowhere. Have a certain ROM on my phone for weeks, then wake up one morning to that error message and problem. Its funky indeed. Tho I have no helpful insight, sorry. :confused:
Sent from my Motorola Electrify using xda app-developers app
 
Last edited:
  • Like
Reactions: Xistance

mg2195

Senior Member
Dec 5, 2011
2,983
2,572
29
RSM
No, hes technically asking about building cm, in a compiling thread. The tiltle does not state aosp, and lots of people have asked for and recieved help for other sources here... :p

Sent from my Motorola Electrify using xda app-developers app

---------- Post added at 08:07 PM ---------- Previous post was at 08:03 PM ----------



Then ur having kernel problems I believe. Logcat wont show anything before a certain point in the boot process. There is some kind of log that will tell u whats going on before that point, but cant remember what it is. Never had to use it.

Sent from my Motorola Electrify using xda app-developers app

---------- Post added at 08:09 PM ---------- Previous post was at 08:07 PM ----------



U know mg, I have had the problem before, but never attacked it from the debugging angle. Just changed my rom. The funny thing is, ive had it happen outta nowhere. Have a certain ROM on my phone for weeks, then wake up one morning to that error message and problem. Its funky indeed. Tho I have no helpful insight, sorry. :confused:
Sent from my Motorola Electrify using xda app-developers app

I think the log you are refernig to as last dmsg or kmsg...

Anyways, finally got an answer from the dev by posting in his thread instead of pming...well kinda, at least enough to get me going :) basically I need to merge a few patches into frameworks/opt/telephony and edit a line in my boardconfig...something about ICS ril and without the patches the phone is essentially looking for something that doesn't exist...attempting a build if it fixes the problem ill let out guys know what I did exactly :)

Sent from my SGH-I997 using Tapatalk 2
 

CptanPanic

Senior Member
Jun 15, 2011
193
66
I am having a new problem. I can use adb when regular booted, but if I do adb reboot bootloader, to get to bootloader, adb cannot find the device anymore. This is with a Nexus 4, and I was previously able to use adb in bootloader, as I did it to root. Note I also tried having seperate lines for each ATTRS{idProduct} in the udev rules.

51-android-rules
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", MODE="0660", OWNER="myuser"

Code:
Nov 30 11:24:53 desktop-ubuntu kernel: [ 1039.762272] usb 2-1.7: USB disconnect, device number 14
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.050819] usb 2-1.7: new high-speed USB device number 15 using ehci_hcd
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.143937] usb 2-1.7: New USB device found, idVendor=18d1, idProduct=4ee2
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.143942] usb 2-1.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.143944] usb 2-1.7: Product: Nexus 4
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.143947] usb 2-1.7: Manufacturer: LGE
Nov 30 11:24:57 desktop-ubuntu kernel: [ 1044.143949] usb 2-1.7: SerialNumber: XXXX
Nov 30 11:24:57 desktop-ubuntu mtp-probe: checking bus 2, device 15: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7"
Nov 30 11:24:57 desktop-ubuntu mtp-probe: bus: 2, device: 15 was an MTP device
Nov 30 11:25:44 desktop-ubuntu kernel: [ 1090.641281] usb 2-1.7: USB disconnect, device number 15

<adb reboot bootloader>

Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.674514] usb 2-1.7: new high-speed USB device number 16 using ehci_hcd
Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.773640] usb 2-1.7: New USB device found, idVendor=18d1, idProduct=4ee0
Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.773645] usb 2-1.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.773647] usb 2-1.7: Product: Android
Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.773650] usb 2-1.7: Manufacturer: Google
Nov 30 11:25:48 desktop-ubuntu kernel: [ 1094.773652] usb 2-1.7: SerialNumber: XXXXX
Nov 30 11:25:48 desktop-ubuntu mtp-probe: checking bus 2, device 16: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7"
Nov 30 11:25:48 desktop-ubuntu mtp-probe: bus: 2, device: 16 was not an MTP device
 

Roladriz

Senior Member
Apr 5, 2010
112
33
Wondering if anyone has seen this before or knows how to fix?

Code:
frameworks/opt/telephony/src/java/com/android/internal/telephony/Phone.java:133: cannot find symbol
symbol  : variable NETWORK_MODE_LTE_WCDMA
location: interface com.android.internal.telephony.RILConstants
    int NT_MODE_LTE_WCDMA                = RILConstants.NETWORK_MODE_LTE_WCDMA;
                                                       ^


http://pastebin.com/0wfj7XnK

EDIT: Resync solved the problem. :)
 
Last edited:

AntiBillOS

Senior Member
Jun 21, 2011
796
1,447
Запорожье
Please help find best choise for fix this problem (then builds gallery2):
http://pastebin.com/1gNDQUrV
Because i just delete (package/apps/gallery2) now.
#Sorry i dont translate last on log:
Ошибка - mean Error.

2. And can you help me fix next error? (its small. I past it here):
Code:
target thumb C++: libaudioflinger <= frameworks/av/services/audioflinger/AudioPolicyService.cpp
frameworks/av/services/audioflinger/AudioPolicyService.cpp:1571:5: sorry, unimplemented: non-trivial designated initializers not supported
frameworks/av/services/audioflinger/AudioPolicyService.cpp:1571:5: sorry, unimplemented: non-trivial designated initializers not supported
frameworks/av/services/audioflinger/AudioPolicyService.cpp:1571:5: sorry, unimplemented: non-trivial designated initializers not supported
frameworks/av/services/audioflinger/AudioPolicyService.cpp:1571:5: warning: missing initializer for member 'audio_policy_service_ops::open_input_on_module' [-Wmissing-field-initializers]
make: *** [/home/antibillos/android/jb/out/target/product/haida/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/AudioPolicyService.o] Error 1
 
Last edited:

skywalker1162

Senior Member
Jan 12, 2012
151
74
Mumbai
Hey guys I'm running into a problem here . I am syncing the repo of aokp from the main source . I leave it on for the night but when I see it in the morning it is stuck on receiving objects : 27% and this is the second time this happened although I can't say for sure why it happens . It just gets stuck there . Can anyone help me in this . Thanks

Skydragon Team
 

triptosyll

Senior Member
Jan 7, 2012
659
459
Mineral Point
Hey guys I'm running into a problem here . I am syncing the repo of aokp from the main source . I leave it on for the night but when I see it in the morning it is stuck on receiving objects : 27% and this is the second time this happened although I can't say for sure why it happens . It just gets stuck there . Can anyone help me in this . Thanks

Skydragon Team

Kill the sync with 'CTRL' and 'c' and then do repo sync again. It should pick up where it left off. If not try again. I had problems like that about 5 times before mine sould completely sync. Cept mine would hang at 98%. Frustrating, it is.

Sent from my Motorola Electrify using xda app-developers app
 
  • Like
Reactions: skywalker1162

Top Liked Posts

  • There are no posts matching your filters.
  • 313
    NOTICE: I'm beginning to see this tutorial on numerous other sites. I'm fine with it being posted on other sites, as long as I am given credit and have your thread point back to here for the pieces that I have specifically written. I do not condone near verbatim or verbatim copy and pasting of my work or others work without credit. Please give credit where credit is due. Thank you.

    07-17-12: I have not, nor shall I ever claim copyright.


    To compile Jellybean on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.

    You MUST be running a 64 bit version of Ubuntu, 32 bit is not supported.

    This will NOT make a fully functional ROM, but will give you a place to start. Also I CANNOT fix every error you run into.

    READ the entire OP and make sure to properly follow instructions. Don't forget to search the thread as your question may have already been answered.

    Please use Pastebin for all errors you run into. Posting a link is much easier than a long list of errors in the thread. Thank you.

    You will need 25GB (or more) free to complete a single build, and up to 80GB (or more) for a full set of builds.

    1) You need the following:
    -JDK 6 if you wish to build Jellybean.
    Code:
    $ sudo apt-get install openjdk-6-jdk

    -Python, which you can download from python.org. Or:
    Code:
    $ sudo apt-get install python

    -Git, which you can find it at git-scm.com. Or:
    Code:
    $ sudo apt-get install git-core

    -Android SDK:
    • Download the SDK here: http://developer.android.com/sdk/index.html
    • Extract the SDK and place it in your home directory.
    • I renamed my SDK to android-sdk to make it easier to navigate to.
    • Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
    • Add these lines at the bottom of the file:
      Code:
      # Android tools
      export PATH=${PATH}:~/android-sdk/tools
      export PATH=${PATH}:~/android-sdk/platform-tools
      export PATH=${PATH}:~/bin
    • Find your .profile file and add this at the bottom of the file:
      Code:
      PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
    • You have now successfully installed the Android SDK.
    • To check for updates issue this into your terminal:
      Code:
      $ android

    2) Install required packages.
    Code:
    $ 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

    On Ubuntu 10.10:
    Code:
    $ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so

    On Ubuntu 11.10:
    Code:
    $ sudo apt-get install libx11-dev:i386

    Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
    Code:
    $ sudo apt-get install git gnupg flex bison gperf build-essential \
      zip curl libc6-dev libncurses5-dev x11proto-core-dev \
      libx11-dev libreadline6-dev libgl1-mesa-glx \
      libgl1-mesa-dev g++-multilib mingw32 tofrodos \
      python-markdown libxml2-utils xsltproc zlib1g-dev
    $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    3) Configure your USB.
    Code:
    $ gksudo gedit /etc/udev/rules.d/51-android.rules

    Inside of this blank text file insert:
    Code:
    #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"

    4) Save the file and close it and then issue this command:
    Code:
    $ sudo chmod a+r /etc/udev/rules.d/51-android.rules

    5) Install the repo:
    Code:
    $ mkdir ~/bin
    $ PATH=~/bin:$PATH
    $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    $ chmod a+x ~/bin/repo

    6) Initialize the repo:
    Code:
    $ mkdir WORKING_DIRECTORY
    $ cd WORKING_DIRECTORY

    6a) For AOSP:
    Code:
    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2
    For CM:
    Code:
    $ repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1

    6.1) For people who have already done a repo init:
    Code:
    $ cd WORKING_DIRECTORY
    AOSP:
    Code:
    $ repo init -b android-4.3_r2
    $ repo sync
    CM:
    Code:
    $ repo init -b cm-10.1
    $ repo sync


    7) When prompted, enter your real name and email address.

    8) Gather the files:
    Code:
    $ repo sync

    9) Continue onto adding a device

    ~How To Add A Device To The List~

    1) Find the github for your device you wish to add. (For me it is the Samsung Epic 4G Touch [codename d710])

    2) Now navigate to the location you are going clone the device tree to:
    Code:
    $ cd WORKING_DIRECTORY/device
    $ mkdir samsung

    3) Clone the github device tree from remote to local: (The name after the branch would be whatever you want that folder to be named so make sure it is whatever standard name would be for your device, example: Nexus One [passion], Nexus S [crespo], Motorola Droid [sholes], HTC Incredible [inc], etc.)
    Code:
    $ git clone git://github.com/CyanogenMod/android_device_samsung_d710.git -b cm-10.1 d710

    4) Now navigate into the folder:
    Code:
    $ cd d710

    5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.

    6) Extract Device Proprietary Files:
    Code:
    $ ./extract-files.sh
    Or:
    Code:
    ./proprietary-files.sh
    Or: See if other repos have your device's proprietary blobs already (like d710):
    Code:
    $ ~/WORKING_DIRECTORY
    $ mkdir vendor
    $ git clone https://github.com/TheMuppets/proprietary_vendor_samsung -b cm-10.2 samsung

    6.1) Some devices have other dependencies like a common device repo. The d710 utilizes a galaxys2-common repo for the galaxys2 family of devices. Clone that repo. From inside the d710 folder:
    Code:
    $ cd ..
    $ git clone git://github.com/CyanogenMod/android_device_samsung_galaxys2-common.git -b cm-10.1 galaxys2-common

    7) Navigate back to your home directory for building:
    Code:
    $ cd ~/WORKING_DIRECTORY

    8) Prepare To Compile:
    Code:
    $ source build/envsetup.sh

    Or:
    Code:
    $ . build/envsetup.sh

    9) Get your list of devices:
    Code:
    $ lunch

    10) Pick your poison.

    11) Now compile ('#' being the number of cores in your processor +1):
    Code:
    $ make -j#

    12) Speed up builds using ccache (optional, but highly recommended):
    Edit your .bashrc and add this line at the bottom:
    Code:
    export USE_CCACHE=1
    Then issue these commands:
    Code:
    $ export USE_CCACHE=1
    $ export CCACHE_DIR=~/.ccache
    $ prebuilts/misc/linux-x86/ccache/ccache -M 50G
    The suggested cache size is 50-100G. (This is size in GB)

    Or for a flashable zip:
    Code:
    $ make -j# otapackage

    ~FIXES~
    If you are running into issues such as:

    Code:
    Which would you like? [full-eng] 5
    build/core/product_config.mk:209: *** No matches for product "full_d710".  Stop.
    Device d710 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
    Repository for d710 not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
    build/core/product_config.mk:209: *** No matches for product "full_d710".  Stop.
    
    ** Don't have a product spec for: 'full_d710'
    ** Do you have the right repo manifest?

    What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_d710.mk therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    If you run into issues with Java being the incorrect version here is the fix:
    Make sure Java 6 JDK is installed by typing in:
    Code:
    $ java -version
    Open the file main.mk in build/core and delete this line from the java error code section:
    Code:
    $(error stop)

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Change all references in your device repo from frameworks/base to frameworks/native

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Apply this patch for guava: https://github.com/CyanogenMod/andr...mmit/c8b97210aa31c9b80b5fd136d8617ebe4e731e09

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Android 4.1+ needs an insecure kernel to use adb: http://xdaforums.com/showthread.php?t=1687590

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This tutorial is based off this one: http://source.android.com/index.html
    13
    I'm going to put this out here for everybody. I received an email from somebody this morning calling me certain names because he thinks I have claimed copyright on this tutorial. I would like everybody here to know that I haven't claimed copyright, nor shall I ever claim copyright. All I ask for is acknowledgement for the parts of the tutorial which I have written because the base tutorial obviously doesn't have everything I wrote. Base tutorial: http://source.android.com/
    11
    You mean i should delete all the files re-sync it again???
    That would be a nightmare for me :(

    Plus I have done make make clean, cleaned trash and synced the sources again (without deleting the files)
    Naw, there is an easy way to fix your environment without needed to resync. If you delete all the repo folders but making sure to keep your hidden ".repo" folder you won't have to download anything. That repo folder holds all the data, it just creates those folders you see, so delete the folders, keep the .repo intact and resync and recompile. There will be no need to download everything.

    for example:
    Not showing hidden files:
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ ls
    abi       build        device      gdk              Makefile  prebuilt   vendor
    android   cts          docs        hardware         ndk       prebuilts
    bionic    dalvik       external    libcore          packages  sdk
    bootable  development  frameworks  libnativehelper  pdk       system
    Showing hidden files:
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ ls -a
    .        bionic    dalvik       external    libcore          packages   .repo
    ..       bootable  development  frameworks  libnativehelper  pdk        sdk
    abi      build     device       gdk         Makefile         prebuilt   system
    android  cts       docs         hardware    ndk              prebuilts  vendor

    I just removed everything:
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ rm -r *
    rm: remove write-protected regular file `Makefile'? y
    lithid@UbuntuLinux:~/Documents/CM10$ ls
    lithid@UbuntuLinux:~/Documents/CM10$
    Repo is still there though with 6 gigs of data
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ ls -a
    .  ..  .repo[
    lithid@UbuntuLinux:~/Documents/CM10$ du -sh .repo
    6.0G	.repo
    Now time my resync for you. > http://paste.ubuntu.com/1104754/
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ time repo sync -j16
    real	5m25.022s
    user	1m28.462s
    sys	0m27.026s
    Everything is now cleaned, and back to a competely fresh working tree, took me about 5 mins shouldn't take anyone over 10-15 to rebase this.
    Code:
    lithid@UbuntuLinux:~/Documents/CM10$ ls 
    abi       build        device      gdk              Makefile  prebuilt   vendor
    android   cts          docs        hardware         ndk       prebuilts
    bionic    dalvik       external    libcore          packages  sdk
    bootable  development  frameworks  libnativehelper  pdk       system

    Sorry for the winded response. Just thought a simple walkthrough might help out some people who don't understand quite everything linux/android yet. I really tried to numb it down lol. Take care.
    8
    Most excellent! Thank you for the quick post after the source drop!

    You're quite welcome!
    8
    hey how would i fix this?



    arget Strip: libssl (out/target/product/galaxys2/obj/lib/libssl.so)
    host SharedLib: libsqlite (out/host/linux-x86/obj/lib/libsqlite.so)
    host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_reflection.cpp
    host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_reflection_base.cpp
    libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area
    host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_reflection_cpp.cpp
    libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area
    host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_reflect_utils.cpp
    host StaticLib: libclangDriver (out/host/linux-x86/obj/STATIC_LIBRARIES/libclangDriver_intermediates/libclangDriver.a)
    host C++: libslang <= frameworks/compile/slang/slang.cpp
    host C++: libslang <= frameworks/compile/slang/slang_utils.cpp
    host C++: libslang <= frameworks/compile/slang/slang_backend.cpp
    host C++: libslang <= frameworks/compile/slang/slang_pragma_recorder.cpp
    host C++: libslang <= frameworks/compile/slang/slang_diagnostic_buffer.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/ConstantMerge.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/ExtractGV.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/GlobalDCE.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/GlobalOpt.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/IPO.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/InlineAlways.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/InlineSimple.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/Inliner.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/Internalize.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/LoopExtractor.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/MergeFunctions.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/PartialInlining.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/PruneEH.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
    host C++: libLLVMipo <= external/llvm/lib/Transforms/IPO/StripSymbols.cpp
    host C++: libLLVMBitWriter <= external/llvm/lib/Bitcode/Writer/BitWriter.cpp
    host C++: libLLVMBitWriter <= external/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    host C++: libLLVMBitWriter <= external/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp
    host C++: libLLVMBitWriter <= external/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
    aapt: warning: string 'gsm_alphabet_default_charset' has no default translation in frameworks/base/core/res/res; found: ko
    host C++: libLLVMBitWriter_2_9 <= frameworks/compile/slang/BitWriter_2_9/BitcodeWriter.cpp
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:23: error: Resource does not already exist in overlay at 'shutdown_reboot_options'; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:24: error: Resource at shutdown_reboot_options appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:25: error: Resource at shutdown_reboot_options appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:26: error: Resource at shutdown_reboot_options appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:31: error: Resource does not already exist in overlay at 'shutdown_reboot_actions'; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:32: error: Resource at shutdown_reboot_actions appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:33: error: Resource at shutdown_reboot_actions appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/arrays.xml:34: error: Resource at shutdown_reboot_actions appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:43: error: Resource at config_networkLocationProvider appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:46: error: Resource at config_geocodeProvider appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:144: error: Resource at config_samsung_stk appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:189: error: Resource at config_networkLocationProvider appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:192: error: Resource at config_geocodeProvider appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:255: error: Resource at config_legacyUmsLunFile appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:258: error: Resource at config_forceDisableHardwareKeyboard appears in overlay but not in the base package; use <add-resource> to add.
    device/samsung/galaxys2/overlay/frameworks/base/core/res/res/values/config.xml:270: error: Resource at config_deviceHardwareKeys appears in overlay but not in the base package; use <add-resource> to add.
    make: *** [out/target/common/obj/APPS/framework-res_intermediates/package-export.apk] Error 1
    make: *** Deleting file `out/target/common/obj/APPS/framework-res_intermediates/package-export.apk'
    make: *** Waiting for unfinished jobs....

    Delete the overlay folder in the device folder.