yashsingh1/xdaforums huggingface dataset:
[Android] Nevuly:
humm.. I found solution this issue, but It is temporarily solution.

ln -sf /usr/bin/ld.gold /home/(your account name)/(build source repository)/prebuilts/gcc/linux-x86/host/(glibc version)/x86_64-linux/bin/ld

check your glibc version in terminal error line.

And If you find it, You need to type this command. And It'll be work.
[Android] Nevuly:
And It has a one more problem.

mkdir -p /home/cnblack/build/sgs2/12.1/out/target/product/i9100/obj/PACKAGING/recovery_patch_intermediates/
PATH=/home/cnblack/build/sgs2/12.1/out/host/linux-x86/bin:$PATH /home/cnblack/build/sgs2/12.1/out/host/linux-x86/bin/imgdiff /home/cnblack/build/sgs2/12.1/out/target/product/i9100/boot.img /home/cnblack/build/sgs2/12.1/out/target/product/i9100/recovery.img /home/cnblack/build/sgs2/12.1/out/target/product/i9100/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
Error: inflate failed [invalid block type] at file offset [2535779]
imgdiff only supports gzip kernel compression, did you try CONFIG_KERNEL_LZO?
failed to break apart target image

I don't know Why I have to fix this trouble :/
[Android] revuwa:
BuilduntuVM

[MENTION=2645562]sylentprofet[/MENTION]: Thanks a lot for that guide.

Do you consider to release an Ubuntu 16.04 LTS based BuilduntuVM (http://xdaforums.com/showthread.php?t=2585828) sometime?
[Android] sylentprofet:
Yes, definitely!

I started work on it, but ran into some issues with the installation process. Once everything is working nicely I'll post an update.

Thanks for the support!
[Android] sylentprofet:
It looks like you're compiling CM 12.1, which is based on Lollipop.

Are you using OpenJDK 7 instead of 8? L uses 7 to compile, 8 is only for M onward.

There are directions at the bottom of the post to switch back to OpenJDK 7 if needed.
[Android] Nevuly:
Reserved
[Android] fgdn17:
I used this fix from cyanogenMOD to solve that issue......good luck

for:

art / build/Android.common_build.mk

# Clang build support.

# Host.

ART_HOST_CLANG := false

- ifneq ($(WITHOUT_HOST_CLANG),true)

+ ifeq ($(WITHOUT_HOST_CLANG),false)

# By default, host builds use clang for better warnings.

ART_HOST_CLANG := true

endif

REF: http://review.cyanogenmod.org/#/c/120824/2/build/Android.common_build.mk
[Android] ShevT:
I have it does not work, to build 12.1
[Android] fgdn17:
should have specified: Marshmallow, doesn't work on Lollipop....

the "real" issue appears to be with libc6 and binutils

libc6 = 2.19-22

binutils = 2.25-4

seems depending on your combination of these sometimes a build works

correctly and sometimes not......so until a stable combo is pushed...this is a temp fix IMO
[Android] sylentprofet:
OP here.

Would it be more helpful for everyone if I separated the installation of OpenJDK into a different step, so you guys can choose 7 or 8 depending on which version of Android being built?

Thanks for the responses everyone!
[Android] qoejohn:
using this method , and the results worked well , thanks dude ;)
[Android] Nevuly:
It just only work in CM 12.1, CM 13.0 is not needed to do this method :D
[Android] sebastiandg7:
Could you finally compile CM 12.1 ??
[Android] sebastiandg7:
Did you have the same problems in Ubuntu 14.04?
[Android] fgdn17:
the official fix for this issue is committed:

https://android-review.googlesource.com/#/c/223100/

https://android.googlesource.com/platform/build/+/5ff9c81b6c0f23dfbc08c95c1294b3b37110ecf0
[Android] fonz93:
This works, the build is ok, but i feel we are missing some cherrypicks, because there are some conflicts i had to solve and they're related to missing patches (that are present on 6.0 branch)

Also, that patch was originally made on the master branch, which is android 6.0
[Android] fgdn17:
yes all commits are to master branch, you need to apply the patch to the branch your using...

before posting I had verified the patch worked on my android-x86-6.0.1_r43 build....

today I back ported the patch to my android-x86-5.1.1_r31 build as it had the same issue and built

fine after the patch was applied.....

cannot answer for cm12.1 or other builds.
[Android] fonz93:
I am indeed talking about cm-12.1 branch
[Android] fgdn17:
cm12.1 = 5.1.1 Lollipop, so you must have other issues...5.1.1 worked fine for me on

Ubuntu 16.04 as I stated....keep checking the android-building group and

android-review.googlesource.com.......
[Android] fonz93:
It worked fine for me too as i wrote previously, but you can see that the 6.0 branch has many patches that 5.1.1 hasn't and we practically skipped them,

even if this is working, it's not ok
[Android] fgdn17:
as you wrote previously you didn't imply you were working with 12.1, Lollipop..anyway

I guess you back port the patches from 6.0 that apply...but I bet any relevant ones have

already been done!! Good Luck.
[Android] tomtom1265:
So do we have a guide to setup 16.04 and compile 12.1? I read the thread but still not sure if we have a working guide or not.
[Android] fonz93:
Follow the guide in the first post (use open jdk 7 for android 5.1.1) and just apply this patch:

https://github.com/MotoG-2013/android_build/commit/253890fefc8310f017acd54ae912a4022c15be3d

And it will build
[Android] pmne324:
Problem with initialize the repo

I have a problem with initialize the repo:

After doing step 8:

Result:

/home/MyUserName/bin/repo: line 1: syntax error near unexpected token `<'

/home/MyUserName/bin/repo: line 1: `<?xml version='1.0' encoding='UTF-8'?><Error><Code>AccessDenied</Code><Message>Access denied.</Message><Details>We're sorry, but this service is not available in your location</Details></Error>'

What I have to do?!

PLZ help my guys!
[Android] surdu_petru:
I managed to build CM-13.0 on 16.04 LTS for a few times using CCACHE, but the time for final build is always almost double like on Ubuntu 14.04 LTS !

Build on 16.04 takes about 1 hour ... but on 14.04 takes about 30 minutes ... has anyone noticed this issue ?

Thank you for the confirmation :o
[Android] Nevuly:
Now, I successful to build CM 12.1 in ubuntu 16.04 LTS

You just follow this commit

https://android-review.googlesource.com/#/c/223100/

If you have boot.img issue, You need to check your device sources.

Error: inflate failed [invalid stored block lengths] at file offset [2535762]
imgdiff only supports gzip kernel compression, did you try CONFIG_KERNEL_LZO?
failed to break apart target image

This error means, You can't use LZO in CM 12.1.

If you can find this line in your ramdisk compress file,

$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET)
$(ACP) -fp $< $@

$(INSTALLED_RECOVERYIMAGE_TARGET): $(recovery_uncompressed_ramdisk)
lzop -f9 -o $@ $<

You must change compress type.

like this

$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET)
$(ACP) -fp $< $@

$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET)
$(ACP) -fp $< $@

Don't use LZO in your own Lollipop. It may issues in your build progress.

I built CM 12.1 for Samsung Galaxy S II, It's work. Just simple.

(Sorry for my bad english, But you can understand my word Maybe :D)
[Android] F-L-Y-E-R:
You can use openjdk-8 to build CM13. Just execute

export EXPERIMENTAL_USE_JAVA8=true

in your build directory.
[Android] Joeisgood99:
Did you get other errors when building cm13 on ubuntu 16? if so did using java-8 stop any of them?

Thanks.

Edit: Also, which make file in the build directory do you set the flag EXPERIMENTAL_USE_JAVA8=true

Or do you mean just type it in terminal before: "make - jx"
[Android] F-L-Y-E-R:
I don't know but this is officially approved by CyanogenMod maintainers because the commit is merged into the source.

Just type it in the terminal from your build directory. I do it before 'source build/envsetup.sh'
[Android] Mawth:
I am trying to build AOSP (specifically android-6.0.1_r43) on Ubuntu 16.04 (to which I just upgrade from 14.04) and I'm not having success. The crux of the error seems to be:

******************************

You have tried to change the API from what has been previously released in

an SDK. Please fix the errors listed above.

******************************

The full list of errors is here on paste bin.

I have followed the instructions in the OP to set up my system. Any ideas on how I can fix the problem? I tried "make update-api" but that has not resolved the problem.

Thanks for the help.

At this point I'm wishing I had stayed on 14.04....sigh
[Android] Joeisgood99:
Im in exactly the same boat as you. I haven't had the api error though for AOSP but did for Omni. I can't get past:

out/target/product/suzuran/obj/ETC/seapp_contexts_intermediates/seapp_contexts.tmp

libsepol.context_from_record: type sysfs_uio is not defined

Haven't had any issues relating to sdk or api like you. It's interesting that were building aosp 6.0 on the same OS with different errors that don't seem to stem from the device tree.
[Android] mad_fitter:
I'm seeing the same kind of API errors while compiling Slim6. Weird. I'm using java 7, because 8 isn't supported in their tree yet.
[Android] sylentprofet:
OP here. For anyone experiencing API errors:

After a bit of research, I may have found a solution. This has been a fix for previous versions.

If you switched from Java 8 back to 7, there's an extra bit of Java switch magic needed. In addition to java and javac, run update alternatives for the following and select openjdk7.

sudo update-alternatives --config javadoc
sudo update-alternatives --config javap
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
[Android] SlimShady's:
Can we build with Java 8 or we must build with 7? :)
[Android] sylentprofet:
It depends which version of Android you're building.

Seems that 7 works best for CM 12.1 / L builds.

8 will be used for the future (CM 13 / M+)
[Android] mad_fitter:
Figured this out on my own, but thank you :)

---------- Post added at 05:14 PM ---------- Previous post was at 05:12 PM ----------

Depends on the tree. CM 13 nightly builds use OpenJDK 8 (iirc), and Slim uses 7 still.
[Android] daneal2u:
Is java v8 required to compile rr on Linux mint cinnamon 18?
[Android] INT3NSE07:
Great guide. Thanks for this op.
[Android] macs18max:
Hey. Has anyone been successfull with this guide by doing what is exactly posted in the OP (No work arounds)

I have been trying but always end up with some errors

I am doubting my hard drive.
[Android] INT3NSE07:
Try this guide http://odste.blogspot.in/2016/04/guide-to-compiling-android-on-ubuntu.html. It works for me and I have no problems building.
[Android] sylentprofet:
Edited OP to make it easier for everyone to install with regards to Java. Should be smooth sailing now.

Interesting, the post linked above comes out the day after I post the guide here, and has suspiciously similar writing and install commands... I strongly suspect copypasta with no attribution, but *shrug* whatever.
[Android] Rx8Driver:
Funny how that happens, huh? Smh...
[Android] macs18max:
Hello sylenprofet. I got a new ssd and still facing the issue. "segmentation error"

Have you compiled cm13 lately with this setup? If yes could you share your local manifest, so that I can try to compile for your device and see if it compiles successfully (Then I can probably say that the errors are from my device commit and not the environment setup). Also I am assuming you are using java8 and not using any "experimental flags ".
[Android] sylentprofet:
Yes, I have compiled CM13 for the OnePlus One and X devices. Also a few other distros randomly for friends on the Nexus 5X and 6.

No experimental flags. I'm actually using OpenJDK7 at the moment, because I used to compile for CM12.1

Can you copy a chunk of the error output? It might help me point you in the right direction.

You may want to try step one (purging java versions) then follow the new directions for step 10 (installing java, sounds like you want 7)

Good luck!
[Android] Slimegod:
I'm getting this kernel error and in not sure why http://pastebin.com/3tHLAJGP. So I deleted the error in line 181 and ran into this error http://pastebin.com/bKnX70tQ. I'm coming from 15.10 I've never ran into these errors. Not even on 14.04. Can anyone help me out.
[Android] sylentprofet:
Try compiling directly from Cyanogen's sources.

Don't forget to add TheMuppets/oneplus vendor libs.

Some googling of sigsegv java runtime show a lot of people with hardware / memory problems. How much memory does your system have? Does it fail at the same exact place every time?
[Android] RagingHarry:
Thnx for the guide, save me some hours testing and do it within a hour to setup.

Cudo's for you!!
[Android] macs18max:
No it's a different error Everytime. Anyways I have switched to 14.04 Lts. Yes it seem like some memory management issues withy laptop. I realise when git crashed too when syncing to spurces. I have only 4gb ram. Let's see how it goes with 14.04 thanks for helping
[Android] macs18max:
[MENTION=2645562]sylentprofet[/MENTION]

I see the issue now. The issue is not environment setup but with my low memory.

I recently move to a 4GB ram latpop. (My older 8GB laptop crashed and after 3 month I am trying this on a newer laptop but it has less RAM which is 4GB)

It seems lately CM recently switched to Jack compiler which is really resource hungry and give this error during building.

There is no way of getting around. I tried a lot of things

1. changing XMX from 512mb to 4096mb in build/tools/releasetool/common.py

2. changing tried to use "make -j1" to avoid parallel running of threads

3. changing Jack property from "SERVER_NB_COMPILE=4" to SERVER_NB_COMPILE=2 or SERVER_NB_COMPILE=1

4. Increase my laptops swap partition to 8GB

Finally I decided not to use Jack compiler by changing the property "SERVER=true" to "SERVER=false" and adding "ANDROID_FORCE_JACK_ENABLED := disabled" to my device BoardConfig.mk in my device(Bacon). (FYI just to make sure the problem is not in my device tree, I am compiling for oneplusone by "lunch cm_bacon-userdebug" )

But these cause additional problems and needs a lot of patches see pictures below and reviewers conversation.

Hope this helps you in future before some start thinking your guide is wrong or think it is java7/8 or 16.04 ubuntu issue. it is not.

Damn you Jack, Damn you. :p
[Android] arvinquilao:
Hi, how was this solved? Did you just re-sync the repo? I'm getting the very same error message too.
[Android] Joeisgood99:
I delete the entire reporo and downloaded the newest revision. Made sure I was using Java 7 and it worked. I edited that post with a detailed explanation on pge 4 or 5. Haven't tried to build android for a number of weeks now.
[Android] sthbr82:
Trying to build PA angler in Ubuntu 16.04, and my builds are not passing through this point

Any workarounds to get through this?

For some reason Ubuntu 16.04 won't allow me to install Open JDK 7, currently stuck with OpenJDK 8.

Trying to find prebuilt JDK 7, and set the path via JAVA_HOME, so far I'm not able to find any.
[Android] fhem:
Increased build times

I am test building on newly released Mint 18 (16.04 base). I have and still am building on Mint 17.3 (14.04 base). I am seeing a very significant (50%) increase in rom build times on 16.04 and the ccache is not building as it should ----- way too many misses. ccache version 3.2.4. I was wondering if anyone else has had similar issues on 16.04??? Builds finish and flash fine --- but the build times are a problem. Also I am building w/ java 8 w/o issues on both 14.04 and 16.04.
[Android] ggow:
Yes, I have noticed the same thing. I have tried this out on multiple machines and different ROM bases.

The build times are way too long compared to Xubuntu/Ubuntu 14.04.4.
[Android] fhem:
Thanks guys looks like we all having the same issues w/ build times 16.04. I guess I will stick to 14.04 until it someone figures it out. Also even though I'm using CCACHE it doesn't build -- way too many misses. Gonna try the fix from here in the comments . Thanks [MENTION=4395895]BeansTown106[/MENTION] for sharing post.
[Android] thach273:
please help me :(

i1108.photobucket.com/albums/h411/thach273/Screenshot%20from%202016-08-07%2023-59-24_zpsnedwi3py.png
[Android] sylentprofet:
repo init -u [B]git[/B]://github.com/CyanogenMod/android.git -b cm-13.0
[Android] Frostyagent:
worked for me, but only make command working, 'make otapackage' not working, anybody can help?
[Android] Nevuly:
No, you don't need to patch this thing. CM was patched it.

And Please use 'make bacon'. (If you want to build CM)
[Android] Frostyagent:
Solved that but now another error

aarch64-linux-android-g++: internal compiler error: Segmentation fault (program cc1plus)

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://source.android.com/source/report-bugs.html> for instructions.

build/core/binary.mk:706: recipe for target 'out/target/product/angler/obj/SHARED_LIBRARIES/libhwui_intermediates/TextureCache.o' failed

make: *** [out/target/product/angler/obj/SHARED_LIBRARIES/libhwui_intermediates/TextureCache.o] Error 4

Can you help me on this
[Android] Nevuly:
Humm.... What kind of ROMs are you build?

If you build CM, CM is not have any problems.
[Android] Frostyagent:
Its Aosp 6.0.1 for Nexus 6p
[Android] Nevuly:
I built AOSP 6.0.1_61 in my debian 8.4.0 Jessie, It not have problems.
[Android] Frostyagent:
I am having this same issue on Ubuntu 14, 15 and 16 .. should i do it in Debian? if yes, then what version to download and how to prepare for android compilation?
[Android] ggow:
Worked perfectly for me too, thanks :)
[Android] yog12:
how much time does it will take for 512KBps connection ? i am downloading from last 20hours

anyone know how much gbs of data it is downloading ?
[Android] Nihhaar:
I had to do for liquid smooth marshmallow. But I am getting different errors.
[Android] zainifame:
[MENTION=2645562]sylentprofet[/MENTION] what really java version needed for compile android 6.0.x ?? jdk 7 or jdk 8 ? cause on this site said android 5.x.x until 6.x.x using jdk 7 ?
[Android] sylentprofet:
Android 6.0 bumped the requirement to JDK 7. But some ROMs (CM13 for instance) support building with 7 and 8 both.

Android 7.0 Nougat requires JDK8.
[Android] zainifame:
ahh :) ok ok, thanks
[Android] kjinx01:
getting this error while installing packages..help me out

manoj@rathore:~$ sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven

[sudo] password for manoj:

Sorry, try again.

[sudo] password for manoj:

Reading package lists... Done

Building dependency tree

Reading state information... Done

automake is already the newest version (1:1.15-4ubuntu1).

bison is already the newest version (2:3.0.4.dfsg-1).

build-essential is already the newest version (12.1ubuntu2).

bzip2 is already the newest version (1.0.6-8).

ccache is already the newest version (3.2.4-1).

g++-multilib is already the newest version (4:5.3.1-1ubuntu1).

git is already the newest version (1:2.7.4-0ubuntu1).

libbz2-1.0 is already the newest version (1.0.6-8).

libbz2-dev is already the newest version (1.0.6-8).

make is already the newest version (4.1-6).

optipng is already the newest version (0.7.6-1).

python-networkx is already the newest version (1.11-1ubuntu1).

squashfs-tools is already the newest version (1:4.3-3ubuntu2).

zip is already the newest version (3.0-11).

zlib1g-dev is already the newest version (1:1.2.8.dfsg-2ubuntu4).

gperf is already the newest version (3.0.4-2).

libghc-bzlib-dev is already the newest version (0.5.0.5-4).

liblz4-tool is already the newest version (0.0~r131-2ubuntu2).

lzop is already the newest version (1.03-3.2).

maven is already the newest version (3.3.9-3).

pngcrush is already the newest version (1.7.85-1).

schedtool is already the newest version (1.3.0-1).

curl is already the newest version (7.47.0-1ubuntu2.1).

dpkg-dev is already the newest version (1.18.4ubuntu1.1).

libxml2-utils is already the newest version (2.9.3+dfsg1-1ubuntu0.1).

The following NEW packages will be installed:

zlib1g-dev:i386

0 upgraded, 1 newly installed, 0 to remove and 114 not upgraded.

Need to get 0 B/167 kB of archives.

After this operation, 403 kB of additional disk space will be used.

Do you want to continue? [Y/n] Y

(Reading database ... 220040 files and directories currently installed.)

Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb ...

Unpacking zlib1g-dev:i386 (1:1.2.8.dfsg-2ubuntu4) ...

dpkg: error processing archive /var/cache/apt/archives/zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb (--unpack):

trying to overwrite '/usr/include/i386-linux-gnu/zconf.h', which is also in package lib32z1-dev 1:1.2.8.dfsg-2ubuntu4

Processing triggers for man-db (2.7.5-1) ...

Errors were encountered while processing:

/var/cache/apt/archives/zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

manoj@rathore:~$
[Android] sylentprofet:
The problem is zlib1g-dev:i386

I did some googling, try this in a terminal:

sudo apt-get -o Dpkg::eek:ptions::="--force-overwrite" install zlib1g-dev:i386
[Android] kjinx01:
still getting the same error bro...:crying::crying:

manoj@rathore:~$ sudo apt-get -o Dpkg::eek:ptions::="--force-overwrite" install zlib1g-dev:i386

[sudo] password for manoj:

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

zlib1g-dev:i386

0 upgraded, 1 newly installed, 0 to remove and 114 not upgraded.

Need to get 0 B/167 kB of archives.

After this operation, 403 kB of additional disk space will be used.

(Reading database ... 220040 files and directories currently installed.)

Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb ...

Unpacking zlib1g-dev:i386 (1:1.2.8.dfsg-2ubuntu4) ...

dpkg: error processing archive /var/cache/apt/archives/zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb (--unpack):

trying to overwrite '/usr/include/i386-linux-gnu/zconf.h', which is also in package lib32z1-dev 1:1.2.8.dfsg-2ubuntu4

Processing triggers for man-db (2.7.5-1) ...

Errors were encountered while processing:

/var/cache/apt/archives/zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_i386.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

manoj@rathore:~$
[Android] manotroll:
I did everything like this in the tutorial and then what do I do?

where does the file?

is already ready for use and or need additional commands?
[Android] sylentprofet:
This is a fresh, brand new installation of Ubuntu 16.04, am I correct? Just trying to help narrow down the cause, because it is a highly uncommon situation. The more info you can provide, the better.

Thanks, I'll try my best!
[Android] manotroll:
after I did all where is the file to write to the phone?
[Android] Infected93:
error bulding using cm13 sources with openjdk-7

system/vold/cryptfs.c error undefined reference to EVP_CIPHER_CTX_init

clang: error: linker command failed with exit code 1 (use -v to see invocation)

this is the one i remember there was undefined references to many EVP variables

Any help would be appreciated.i was at my first step to create recovery image using make -j4 recoveryimage

boot.img was generated.at alst steps of building this error was reported and make failed.

Will post full report if necessary.i am at my office and this is all i could remember.
[Android] sylentprofet:
Sounds like you're using / missing a custom compiler toolchain?

Not much information to go on.
[Android] sylentprofet:
/home/username/android-directory/out/target/product/device-name/release-flavor-device-name-date.zip
[Android] manotroll:
he did not create this folder

how do I choose the device that it should create the rom?
[Android] Infected93:
Will you share your email id so that i could mail the whole log as txt file.i m a new user at xda and they won't allow me to post links here.