- 01-02-2013, 07:41 PM #251
Re: [GUIDE][Ubuntu] Compiling Android from Source
You don't apply in terminal. Go into the folder that to repo synced to then navigate to here
guava/src/com/google/common/collect/Maps.java
Once there delete the lines with a minus next to them and add the lines with the plus next to them from the patch link then save.
Sent from my Galaxy Nexus using Android Central Forums - 01-02-2013, 07:44 PM #252
Re: [GUIDE][Ubuntu] Compiling Android from Source
This is really good info. I had no problems findng the blobs on my stock/rooted GN. I made subdirectories in the vendor folder correspondng to each blob. The next part i am really unsure of. I copied and pasted the comtents of the self-extractor folder into each blob folder. I then made clobber, and proceded with building. This doesnt seem right to me after we has to accept the other binaries. I dont have a clue how to modify the Android.mk file or create a new mk file for each of the new blob directories. Can someone help or point me in the right direction? - 01-04-2013, 01:40 AM #253
Re: [GUIDE][Ubuntu] Compiling Android from Source
Fantastic guide! This has been very helpful in getting me over the first time fears of setting things up.
I've compiled a full_toro_userdebug build, and it flashes, but won't boot. I pass the Google splash screen like normal, but then things just hang on a black screen (there's no bootanimation.zip present in my zip at all). I seem to have things set up properly, and the only "error" I'm getting is a "No file_contexts" warning. I'm wondering if anyone has any thoughts on the matter... Any/all help would be much appreciated.
- 01-04-2013, 07:26 PM #254
Re: [GUIDE][Ubuntu] Compiling Android from Source
I had that same problem today. Spent 3 hours compiling only to realize I forgot to extract the Samsung CDMA/LTE proprietary. That resulted in a BSOD after the Google logo finished. Funny thing was I could access the device via adb and reboot the boot loader. There's a really good discussion on page 8 of this thread regarding the binaries. You need to extract several binaries from the stock ROM and add to the build.
Today, January 4, 2012: the day I compiled and installed my first (of many to come) AOSP ROM on my VZW GN. Now, if someone could share the Nexus 4 binaries, I could apply this guide to that device as well.
- 01-05-2013, 12:13 AM #255
- 01-05-2013, 02:07 AM #256
Re: [GUIDE][Ubuntu] Compiling Android from Source
Thank you very much! I'll have some time tomorrow afternoon to sit down and take a look at the binaries.
I had a build I thought was good today, but I forgot to remove the recovery folder...ten guesses what happened... I nuked TWRP, and could only boot into the bootloader. I was out all day, so I had to wait hours to get home and fastboot TWRP back onto the phone, to restore my backup. Fun... Lol
Hopefully, I'll be able to get those binaries taken care of, and finally get a build going tomorrow. Then it's onto theming it and adding a couple of choice scripts I'd like to include. Thank you again for pointing me in the right direction.
:thumbup:
Last edited by jjhiza; 01-28-2013 at 02:19 AM.
- 01-06-2013, 11:26 AM #257
Re: [GUIDE][Ubuntu] Compiling Android from Source
Hey guys, before I go any farther with trying to get a build together, I'd like to verify which branch I synced with. I believe I did my repo sync with the 4.2.1_r1 tag (which is what I want), and not the master branch, but I can't be sure. I've been through my file system, and can't figure it out... Is there a command line I can enter, that will give me the info I'm looking for?
And on the off chance that I've synced with the master branch, how would I go about deleting those files, so I can sync with 4.2.1_r1, and not have to worry about having 100GB of repo files on my HDD?
Thank you to everyone for all the help. I'm new to both ROM building, and Linux (command line)... Please bear with me. :o - 01-13-2013, 02:41 PM #258
- 01-18-2013, 07:23 AM #259
- 01-29-2013, 12:40 AM #260
Re: [GUIDE][Ubuntu] Compiling Android from Source
Hey guys! I finally got all my issues worked out, and have compiled a 4.2.1 build that flashes, boots, has root, and all...THANK YOU for this guide!!!
The only issue I'm having at the moment is that radios are not included in the source, which leaves me with no signal of any kind. I have the radios, and I could flash them, but I'd rather build them into the ROM...Is there any way I can do this? If so, what is the path that I should drop the "radio-cdma.img, radio.img, and radio.img.p" files into (.../vendor/samsung by chance)? Thank you again for all the help, and thanks in advance for any feedback!
Update: issue resolved!
Last edited by jjhiza; 01-30-2013 at 08:43 PM.
- 02-05-2013, 11:19 PM #261
Re: [GUIDE][Ubuntu] Compiling Android from Source
jjhiza, where did you put the radios? Can you elaborate?
I've got AOSP building right now (just the "master" version which I assume is 4.2.1 for toro). I didn't go throught the proprietary driver step since they already appear to be in the source tree. I also didn't verify git tags or do ccache.
I was able to get java6 installed through some ppa repository. - 02-05-2013, 11:39 PM #262
Re: [GUIDE][Ubuntu] Compiling Android from Source
As soon as I get home tomorrow, I'll post all the information for you. I built from the 4.2.1_r1 branch, which does have drivers, but not the proper binaries for CDMA/LTE, GPS, NFC, etc. I'm not sure exactly how the Master branch operates, but my build booted with the incorrect binaries... I just had no signal. The patched ones I found work perfectly though.
I did verify git, but didn't go the ccache route, because I don't plan on building for anything besides Toro for a while.
Java was a pain for me... I had to purge the version that comes with Mint 14, and install version 6 fresh. I'm new to Linux, so figuring out how to do that took me a little while.
Stay tuned though... Like I said, I'll get you the binaries info tomorrow.
- 02-06-2013, 11:49 AM #263
Re: [GUIDE][Ubuntu] Compiling Android from Source
I just downloaded the 4.2 binaries from google's building for devices page. And they seemed to extract correctly to /vendor folder. I used "make clobber" to delete my previous build, setup ccache (with a few headaches, but got it working it seems -- google's directions are not very transparent). And initiated another build... this time with "make -j9 otapackage" hoping that it will make a flashable zip...
- 02-06-2013, 01:39 PM #264
Re: [GUIDE][Ubuntu] Compiling Android from Source
Just noticed this on google "known issues" page:
========================================
Camera, GPS and NFC don't work on Galaxy Nexus.========================================
Symptom: Camera, GPS and NFC don't work on Galaxy Nexus. As an example, the Camera application crashes as soon as it's launched.
Cause: Those hardware peripherals require proprietary libraries that aren't available in the Android Open Source Project.
Fix: None.
Are the binaries offered on enough to fix this? I didn't see camera or GPS listed there, but NFC is.
EDIT: just found with some seemingly good info about camera and GPS. I figured that maybe I could take all the missing files out of an AOKP 4.2 build or a Cyanogenmod 10.1 nightly, since they are both 4.2 based.
My AOSP build had fRom and libpn544_fw.so, but was missing CellBroadcastReceiverVZW.apk, sirfgps.conf, ducati-m3.bin, and /gps.omap4.so. I found them in the AOKP mr1 build-2. I don't know if its kosher to pull the files for my own build and say I did so in this forum, so please correct me if I am breaking any rules.
Also, there were some VZW files in the AOKP rom that were missing from my build: VerizonSSO.apk, VZWAPNLib.apk, and VZWAPNService.apk missing from /system/app/. I'm not sure if those are needed for the phone to function on the Verizon network or not though... Maybe I can just drop all those in the correct locations in my AOSP diy-build otapackage...
EDIT 2: hm... the cyanogenmod nightly doesn't have VerizonSSO.apk or CellBroadcastReceiverVZW.apk... maybe unnecessary... but then why are they included elsewhere?
EDIT 3: The ducati-m3.bin and /gps.omap4.so files are slightly different between AOKP and Cyanogenmod... the former is a few bytes larger in the AOKP and the latter is 4KB larger in AOKP. kinda weird. The 'last modified' dates on them were exactly 21 hours apart, which is either due to time zone differences... or possibly different builds by the OEM devs? probably none of this really matters, but maybe useful info to have here.
EDIT 4: the ducati-m3.bin file is in my aosp source tree; sirfgps.conf and gps.omap4.sa are not. WHen I tried edited android.mk and device-partial.mk as described by Anders, I got an error: "no rule to make target /vender/samsung/toro/proprietary/ducati-m3.bin". And the build stopped. I also tried changing LOCAL_MODULE_OWNER names from samsung to "ti" and "csr" as I saw that on another webpage. No luck, build still stopped.
So I undid the .mk file changes, but left sirfgps.conf in the /vendor/samsung/toro/proprietary folder of WORKING_DIRECTORY. However, I think it probably won't be incorporated into the build. I guess adding them in the end manually is the only way to go?
Is there anyone who knows how to build AOSP 4.2 for toro (without having to manually add anything to the output build) and have it all working, camera, gps, and all?Last edited by dhworph; 02-06-2013 at 06:54 PM. Reason: more things tried...
- 02-10-2013, 05:49 PM #265
Re: [GUIDE][Ubuntu] Compiling Android from Source
Ok, I think I've found a potential solution. Using clues form .
The thing to do is to compile the code and ignore problems with adding proprietary binaries. Then once the code is compiled, you can put the binaries in the proper place in the "out" build directory and then make an otapackage from that. The ota package will include them and be signed and all that goodness.
There also seems to be a way to generate the ota without the recovery too, I'll work on that later.
I guess if you don't want to generate an otapackage, you can just use fastboot flashall after putting the binaries in the appropriate locations in "out" build directory. - 02-12-2013, 10:09 AM #266
Re: [GUIDE][Ubuntu] Compiling Android from Source
Heya guys ,
I am a newbie w.r.t to creating a custom ROM. I followed the amazing set of instructions here , on Ubuntu 12.04 , android branch : android-4.1.1_r6.1 (and not the master) , jdk : 1.6.0 and with proprietary binaries, for Nexus - grouper. However , during the build , I came across this error :
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.util.ExceptionWithContext: Index: 1, Size: 2
at com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:46)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:344)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
at com.android.dx.command.dexer.Main.processClass(Main.java:483)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
at com.android.dx.command.dexer.Main.access$400(Main.java:67)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
at com.android.dx.command.dexer.Main.processOne(Main.java:418)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:174)
at com.android.dx.command.Main.main(Main.java:91)
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 2
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.remove(ArrayList.java:387)
at com.android.dx.ssa.Dominators.compress(Dominators.java:136)
at com.android.dx.ssa.Dominators.eval(Dominators.java:160)
at com.android.dx.ssa.Dominators.run(Dominators.java:207)
at com.android.dx.ssa.Dominators.make(Dominators.java:90)
at com.android.dx.ssa.DomFront.run(DomFront.java:90)
at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:298)
at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:52)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:99)
at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:73)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:273)
... 14 more
...while processing rxGetMonoStereoMode ()I
...while processing com/ti/fm/IFmRadio$Stub$Proxy.class
1 error; aborting
make: *** [out/target/common/obj/JAVA_LIBRARIES/fmradioif_intermediates/noproguard.classes-with-local.dex] Error 1
make: *** Waiting for unfinished jobs....
Can someone please help me out with what could be the issue ? Is it the fact that I compiled an earlier branch when on 12.04 it supports only master ? Or is it something else completely ?
Thanks a ton in advance!
- 02-12-2013, 09:11 PM #267
Re: [GUIDE][Ubuntu] Compiling Android from Source
I just tried to install my build of 4.2.1_r1.2 and it failed.... set_perm (status 7) error
Here was my process:
1. Compile AOSP branch 4.2.1_r1.2
2. Delete recovery folder from the ota
3. resign it with signapk.
I've gotten this error from two of my builds, the other was from master branch. Kinda wierd... maybe I have no choice but to not delete the recovery folder?
Edit: ok, the second time my phone got totally f****d! I was a bit lost since my phone no longer seemed to have a filesystem, so I flashed the factory 4.1.1 image using a GNex toolkit, rerooted and restored a nandroid.
I think part of the problem was caused by this line in tersion of the camerahe updater-script:
It makes sense that would wipe my sdcard clean. And after deleting the recovery folder from my aosp zip, I realized I should probably have deleted the recovery parts of the updater-script:Code:format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "0", "/data");
I'm thinking about trying to flash it again, but I'm worried that the permissions for the proprietary vendor files I added won't be set correctly. I'm not sure if I have to edit the updater script for those (sirfgps.conf, ducati-m3.bin, and gps.omap4.so). You know I'm into this when I can recall those file names by heart... lol.Code:package_extract_dir("recovery", "/system"); set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
Also, I'm not exactly sure what to do about "file-contexts", and I'm pretty sure I don't have to worry about "update-binary"... but maybe...
Edit: Ok finally got a 4.2.1_r1.2 build to flash, however, the photosphere camera isn't working, although gps is. I am pretty sure I have all the needed files (there were 3 to add). Also, root doesn't work even though the su binary is present... and I did full_toro-userdebug. weird... however, I just flashed a root zip to get root back. And I flashed a version of the camera (gallerygoogle flashable zip) that was floating around on the net. wiped cache and dalvik and the photosphere camera seems to work now. not sure if the problem was with the lib files, or the apks... but got it working. I'm going to drive this for a few days to live out my AOSP glory... lol...
Last edited by dhworph; 02-14-2013 at 04:07 PM.
- 02-16-2013, 08:43 PM #268
Re: [GUIDE][Ubuntu] Compiling Android from Source
Nice amount of info here! I always wondered what else I could do with my Ubuntu 4P 32 core server board...Other then fold proteins.
What kind of HD space does one need? More then 128 GB SSD?
Congrats to all who compiled their own builds. I can see what kind of patience and work went into it.
Google GN (4.2.2) N4 (4.2.2), iphone 5, Galaxy S2 (PureGNexus ROM ics),N7(4.2.2) AT&T - 02-19-2013, 02:37 PM #269
Re: [GUIDE][Ubuntu] Compiling Android from Source
I have Ubuntu 12.04 running in virtualbox on windows 7 x64. 128GB virtual hard drive allocated to ubuntu out of 750GB total hard drive. I compile with -j9 (quad core cpu with 8-16 threads), and it takes an hour. Also I have 10GB RAM out of 16 total allocated to ubuntu virtual machine.
Edit: One AOSP build is about 17GB (JB branches), the entire synced source code can vary in size... its about 35-50GB for me including one build.Last edited by dhworph; 02-19-2013 at 10:16 PM.
- 02-23-2013, 06:50 AM #270
Re: [GUIDE][Ubuntu] Compiling Android from Source
Hi, I'm using Pantech Sky Vega S ( It's similar to HTC Incredible S about CPU chipset, GPU, screen resolution (480x800) and dimension (4.0 inch)).
This phone appears to be not supported anymore, and I want to build my own rom for this.
My question is:
Can I build my rom for this phone by following this guide? ( I have followed some guides from xda and still stucking with bunches of errors).
Thanks so much. - 02-26-2013, 11:33 AM #271
Re: [GUIDE][Ubuntu] Compiling Android from Source
So I'm trying to build this for the Galaxy Nexus toro and it's simply not showing toro for any of the options.
When running source build/envsetup.sh I'm not even seeing it there:
~/JB_SOURCE$ source build/envsetup.sh
including device/asus/grouper/vendorsetup.sh
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/armv7-a/vendorsetup.sh
including device/moto/wingray/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/samsung/maguro/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
Any help is appreciated! - 02-26-2013, 11:45 AM #272
Re: [GUIDE][Ubuntu] Compiling Android from Source
- 03-04-2013, 09:56 PM #273
Re: [GUIDE][Ubuntu] Compiling Android from Source
Need a little help I downloaded source all is good there. Synced a couple of times no issues, built twice with no error that caused the build to stop anyway. Loads well 4.2.2 with updated binaries. Everything seems to work will except camera. Gallery works but camera FC, and I tryed Muzzy's gallery apk but didn't work so its not a gapps issue. I Can post a pastebin of the build if necessary. Thanks in advanced.
- 03-05-2013, 10:26 AM #274
Re: [GUIDE][Ubuntu] Compiling Android from Source
It is expected for the camera and gps to not work when building AOSP from source (see my post above). I haven't built 4.2.2, so maybe it is different, but when building 4.2.1, there were 3 missing binary files: sirfgps.conf, ducati-m3.bin, and gps.omap4.so. I would compare your AOSP rom to a stock flashable rom or a custom rom to see what files you are missing and then start googling around to see what those files do. Also, note that some G-Apps packages floating around, that are supposed to be flashed with custom roms, often have some files you might need or find useful. For example, face unlock app and binaries ("pitt patt" vendor folder - i think), and also various camera apps (they will usually overwrite whatever camera app was included with your AOSP rom).
Hope this helps. - 03-05-2013, 11:22 AM #275
Re: [GUIDE][Ubuntu] Compiling Android from Source
You are exactly right I found GPS didn't work. Thank you so much for some direction that's all I needed. When I figure it out I will post it. Also my build was running extremely well Bluetooth was great WiFi was good and super smooth.




Reply


































