yashsingh1/xdaforums huggingface dataset:
[Nexus 6P Android Development] airbat:
This is not a NINJA issue, it's just during NINJA compilation that your error happened. NINJA is just to optimise and speed the compilation itself, so you don't really need it.

It is a PYTHON issue. I have solved my problem with using a virtual environnement of Python2 insteed of Python3.

You have to try to install the package python2-virtualenv

and then open terminal, just go in your repo folder and make your virtual env

# virtualenv2 venv
# source venv/bin/activate

After that, your prompt is now

(venv) #

Simply compile the rom or do whatever you want.

After the job is done, simply use this command to exit from the virtual env

deactivate
[Nexus 6P Android Development] mohammed510:
[ 39% 15643/39489] Building with Jack:...k_intermediates/with-local/classes.dex
FAILED: /bin/bash /home/chemist/pure/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by [email]android-jack-team@google.com[/email])).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
[ 39% 15643/39489] Building with Jack:...rt-v4-donut_intermediates/classes.jack
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (43:30 (mm:ss)) ####

root@chemist-Lenovo-Y50-70:/home/chemist/pure#

out of memory?? how do i solve this? kindly advice
[Nexus 6P Android Development] nathanchance:
It's telling you the amount of RAM you have isn't enough. If you are compiling in a VM, try raising the amount of RAM. If that is your desktop, you may try increasing your Jack heap size, which you might need to do anyways (see this post: http://xdaforums.com/showthread.php?t=3460446&p=68720089)
[Nexus 6P Android Development] Step-han:
Compiling now, cursious how long it will take with a VM with 4 cores of my i7 4700HQ assigned and 4GB of rams in use..

Could someone tell me whats the right way to flash Pure N? I'm now on latest Pure M from 21/08.

- Newest TWRP?

- Full wipe?

- Flash vendor/radio/bootloader?

- Flash rom?

- Done?
[Nexus 6P Android Development] mohammed510:
4gb ram might not be enough. I'm using 8gb and it says out of memory...
[Nexus 6P Android Development] Step-han:
It is still compiling started 10:53. Its now 11:42 here.
[Nexus 6P Android Development] airbat:
You really need more than 4GB ram.

When i compile, my system use near 8GB of RAM as you can see

[IMG="Ressources ussage"]http://dl-1.va.us.xda-developers.com/3/8/7/7/8/3/8/Screenshot_20160917_120713.png?key=OI-gYpHr3DmyqW8lx-a6SQ&ts=1474107061[/IMG]
[Nexus 6P Android Development] kipue:
Yeah, I really wish the process would use the swap area.

But as I could see it never does (on your machine it does not either). I really had to buy more RAM to make it to the end lol.
[Nexus 6P Android Development] Orvils:
Just finished first build. After reading the OP it was pretty straight forward, thanks for the guide. ;)

I got this at the end:

[100% 41943/41943] Package Complete: /.../pure_angler-7.0-20160917-HOMEMADE.zip

#### make completed successfully (01:06:46 (hh:mm:ss)) ####

I assume it is ok to flash it? Just want to make sure as it is first time I am compiling rom myself.

Also I had a question about ccache. I did not enable it as it was recommended to have 50gb for ccache. I only have 30gb free on my Ubuntu partition (don't need much because I triple boot and mainly use windows.)

I synced repo and built on a different ssd.

Was just wondering - is it possible to setup ccache on a different partition?

Also how much ccache will help in future builds?
[Nexus 6P Android Development] dbroer91884:
Any help on this. I don't know what it means.
[Nexus 6P Android Development] 1112ee:
So i left it building on the 8core 24gb ram ssd google cloud machine overnight

#### make completed successfully (01:37:12 (hh:mm:ss)) ####

Does this md5 look right?

fca713f0784ca51a4af51958bd7efcbb
[Nexus 6P Android Development] :
We will all have a slightly different version depending on when you built. If you didn't see any error, the build is most likely good. Just back up and flash :)

EDIT: That doesn't mean that no one will have the same md5, just that you don't need to (or shouldn't) rely on it to know if the build is good.
[Nexus 6P Android Development] mohammed510:
insufficient amount of RAM.
[Nexus 6P Android Development] 1112ee:
welp, google play services keeps stopping in setup
[Nexus 6P Android Development] kipue:
Happened to me one time only. I used Open Gapps Nano flavour.

(also not sure it's OK to discuss the build itself?)
[Nexus 6P Android Development] 1112ee:
Hmm what do you mean only one time? I rebooted but its still force closing when connecting to the network

I'm using stock opengapps
[Nexus 6P Android Development] kipue:
I mean only once on initial boot. Dissmissed the FC message and all went well.

I read on other OPs that you should not use stock open gapps, and at least no bigger than nano version.

Other rom developpers with 7.0 version link to some gapps versions, try one of those, but I would recommend using nano gapps then install whatever you need.
[Nexus 6P Android Development] 1112ee:
I'm building banks dynamic gapps now, I'll try that

Never mind that's for 6.x.x, I'll just try what you said
[Nexus 6P Android Development] 1112ee:
Trying to build with a couple tweaks is this the right way to do it?

Go to ~/pure/frameworks/base/core/res/res/values, modify what I want, then clobber/build again without syncing?
[Nexus 6P Android Development] kantjer:
You can skip the clobber and see if it builds

Sent from my Nexus 6P
[Nexus 6P Android Development] 1112ee:
Well I did clobber, guess I'll see how it goes.

I should be able to dirty flash it over the the same build right?
[Nexus 6P Android Development] kantjer:
Yes you can dirty flash. Remember the next sync will remove your changes if you committed them, if you didn't commit you will get a sync error.

Sent from my Nexus 6P
[Nexus 6P Android Development] dbroer91884:
So then my question is this, my computer has 8 gigabytes of RAM and I'm running Linux Mint with a dual boot on Windows 10 so all 8 gigabytes should be used by Linux. What would I need as a minimum amount of ram in my computer to be able to do this? I've seen people mentioning 16 gigabytes. Does that seem to be working for everyone?
[Nexus 6P Android Development] Gizmoe:
I had 16gb split between windows and my VM and it was not enough. I now use 32gb with about 20gb dedicated to my VM. Can't short windows too much either or it will choke.
[Nexus 6P Android Development] aalupatti:
[MENTION=3306843]kantjer[/MENTION] or [MENTION=6842057]nathanchance[/MENTION]

Sorry to ask the question here.

I have no issues with building pure

I was trying to build benzo and get the following error. http://pastebin.com/0hjEvAZv

The build ran for a few hours before the above error showed up.

Any suggestions please.
[Nexus 6P Android Development] nathanchance:
Hmm looks like something that Benzo did. Did you check Github to see if there were any recent commits related to that?
[Nexus 6P Android Development] aalupatti:
The link to github https://github.com/benzoroms

I have not seen anything specifically
[Nexus 6P Android Development] kantjer:
Try syncing again, Benzo just pushed an app/settings fix

Sent from my Nexus 6P
[Nexus 6P Android Development] aalupatti:
Just saw that thanks

Sent from my Nexus 6P
[Nexus 6P Android Development] Nekromantik:
Nathan is Pure the only N ROM you built so far?
[Nexus 6P Android Development] nathanchance:
I've built Pure, Dirty Unicorns, AOSiP, and MapleAOSP.
[Nexus 6P Android Development] Nekromantik:
I love DU its amazing what they done but uses CMTE and most of my paid for themes are substratum now.
[Nexus 6P Android Development] nathanchance:
Right now, it has legacy Substratum support because they haven't added any CMTE code.
[Nexus 6P Android Development] chopt51:
I'm a little confused trying to build pure. My machine was set up to build DU and it worked.

It's been a while. Now when I try to build pure I see "ninja" and emulators. I've never noticed that before.

Normally everything builds on my machine. Which is mint. I synced the whole source a week ago. now I'm trying to build and Repo sync commands failing? And normally my terminal is blasting thousands of lines a minute.

I'm using commands.

. build/envsetup.sh

brunch angler

Is this some sorta setup for a VM?

I'm at 8% now. Don't care where it builds really as long as it works. But what is ninja?
[Nexus 6P Android Development] aalupatti:
Use this before building

export USE_NINJA=false

Sent from my Nexus 6P
[Nexus 6P Android Development] chopt51:
Oh yeah. Added that just now. Do you think I need the 18gig android-sdk still? I didn't see that in the guide. Wanting to free up some space
[Nexus 6P Android Development] AzraelsKiss:
http://xdaforums.com/showthread.php?p=68675629#post68675629

Use Nano or Pico OpenGapps... I use the aroma version, but I don't install webview a few other packages. I have no problems with Play Services crashing, but don't know for sure if it's webview or one of the other packages that causes the crashes.

http://xdaforums.com/showthread.php?p=68675629#post68675629

I believe ninja is new in nougat... You can disable it, as has been posted all over this thread, but it isn't necessary in order to build... As long as your rig can handle it...

Good luck! Have a good one!
[Nexus 6P Android Development] aalupatti:
Nope

Sent from my Nexus 6P
[Nexus 6P Android Development] Juzman:
Checked that ROM out, it's looking decent. Almost what Pure will be (minus phh's superuser, hyperfox and all those extras). Looking forward to a bunch of merged changes in github.
[Nexus 6P Android Development] nathanchance:
Yup, Joe does good work. Big fan of his from the stuff he does with Electron lol.
[Nexus 6P Android Development] AzraelsKiss:
The Android SDK is needed mainly just for adb and fastboot... If you don't use them with your Linux install, you can be rid of the whole bit... Otherwise, just keep the tools and platform tools...

The build tools and images shouldn't be necessary...

Have a good one!
[Nexus 6P Android Development] Juzman:
Almost makes me want to flash Maple, but I don't want to veer from Pure. Haha.
[Nexus 6P Android Development] qsec:
It seems my laptop has insufficent specs to build. i got a stationary pc i7 with 20gb ram and a 256gb ssd running win 10. I have about 200gb free disk space now.

Would that one be able to build in a vm with Mint?

If so what vm software do you guys reccomend?

I rather use a simple vm than an advanced.

Thanks.
[Nexus 6P Android Development] JedixJarf:
vmware player, its free (non-pro version)

http://www.vmware.com/products/player/playerpro-evaluation.html
[Nexus 6P Android Development] qsec:
Yea, i have read about that one. I will have a go with that, thanks.
[Nexus 6P Android Development] mohammed510:
I'm getting this error. please help.

Communication error with Jack server (56). Try 'jack-diagnose'
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (01:20:53 (hh:mm:ss)) ####

root@chemist-Lenovo-Y50-70:/home/chemist/pure#

---------- Post added at 01:30 PM ---------- Previous post was at 01:15 PM ----------

[/COLOR]

I'm trying to build using Lubuntu as it uses much less ram than Ubuntu. I'm using 8 gb ram as-well but i would say 12 to 16 gb ram should be enough.
[Nexus 6P Android Development] kipue:
In my experience 10 Gb is the veeeeeeeery minimum. Anything below (I use Ubuntu 16.04 normal flavor) and it would end badly, usually at the jack thing moment. That really is when the quantity of RAM makes a difference it seems.

EDIT : by the way, the jack error is very likely due do running out of memory. I had that error forever before raising enough (error 28 sometimes, sometimes error 41)
[Nexus 6P Android Development] qsec:
In beginning of the guide in the op it says

'bash <script-name>'

Should i run all the scripts in the scripts folder or just some of them?

i used tu run them all but some got error messages.

thanks,
[Nexus 6P Android Development] KennyG123:
I just want to say kudos to all in this thread! THIS is what XDA is all about...teaching and helping others learn the start of development! Hoping this inspires other threads on XDA for building from source and blossoms into learning how to customize your own personal build!

Great job guys!!
[Nexus 6P Android Development] Nekromantik:
If you make any changes to manifest.xml to remove repos for LG devices and you commit them. Will repo sync fail next time?

I just tried a sync and it failed after 40%, this is my second sync.
[Nexus 6P Android Development] Taker18:
Normaly no, should be fine with a:

repo sync --force-sync
[Nexus 6P Android Development] kipue:
No, just the one correct for your linux flavor.

So if you use Ubuntu 16.04, do "bash ubuntu1604.sh", or "bash mint18.sh" etc.

that's it, just one
[Nexus 6P Android Development] qsec:
Running Mint 18, so there is one script to run?

linuxmint18x.sh

I did run them all, is something fubar because of that?

Thanks.
[Nexus 6P Android Development] kipue:
Yeah, really just the one for your flavour (ignore my command lines, they were by memory).

Not sure you broke anything, in dougt, just start from the ground up, make a new VM install if you can. I would do it this way :)
[Nexus 6P Android Development] qsec:
Yea, better to be safe than sorry, thanks.
[Nexus 6P Android Development] aalupatti:
[MENTION=6842057]nathanchance[/MENTION] great work on the first post...

I now build regularly but ur guide on the first post is the most comprehensive yet simple for any newbie. One cannot go wrong if they follow the instructions

Sent from my Nexus 6P
[Nexus 6P Android Development] laxattack:
anyone have any suggestions for this error?

target SharedLib: libETC1_32 (/home/laxattack/Pure/out/target/product/angler/obj_arm/SHARED_LIBRARIES/libETC1_intermediates/LINKED/libETC1.so)
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin/ld: error: /home/laxattack/Pure/out/target/product/angler/obj_arm/SHARED_LIBRARIES/libETC1_intermediates/ETC1/etc1.o: file is empty
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/shared_library_internal.mk:81: recipe for target '/home/laxattack/Pure/out/target/product/angler/obj_arm/SHARED_LIBRARIES/libETC1_intermediates/LINKED/libETC1.so' failed
make: *** [/home/laxattack/Pure/out/target/product/angler/obj_arm/SHARED_LIBRARIES/libETC1_intermediates/LINKED/libETC1.so] Error 1
make: *** Waiting for unfinished jobs....

#### make failed to build some targets (03:08:14 (hh:mm:ss)) ####
[Nexus 6P Android Development] 1112ee:
has anyone been able to pass SafetyNet with pure no root?
[Nexus 6P Android Development] mohammed510:
using prebuilt boot.img from IMAGES...
boot size (12689408) is 37.82% of limit (33554432)
no bootloader.img in target_files; skipping install
no radio.img in target_files; skipping install
running: openssl pkcs8 -in build/target/product/security/testkey.pk8 -inform DER -nocrypt
running: java -Xmx2048m -Djava.library.path=/home/chemist/pure/out/host/linux-x86/lib64 -jar /home/chemist/pure/out/host/linux-x86/framework/signapk.jar -w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 /tmp/tmpRdCnoS /home/chemist/pure/out/target/product/angler/pure_angler-ota-eng.root.zip
done.
[100% 22185/22185] Package Complete: /.../pure_angler-7.0-20160918-HOMEMADE.zip

#### make completed successfully (48:34 (mm:ss)) ####

root@chemist-Lenovo-Y50-70:/home/chemist/pure#

i did it :D:D:D:D:D

using i7 4710hq

samsung evo 250 ssd

12gb ram
[Nexus 6P Android Development] nathanchance:
Congrats! That's a real solid build time, it will get better if you enabled ccache
[Nexus 6P Android Development] mohammed510:
making a thread to teach others how to build and sticking around to answer their questions patiently!!! you, sir, made my dreams come true. god bless you :good::good:
[Nexus 6P Android Development] mrjaydee82:
Getting this...any ideas?
[Nexus 6P Android Development] nathanchance:
Type ./prebuilts/sdk/tools/jack-diagnose

I'd also disable Ninja:

export USE_NINJA=false
[Nexus 6P Android Development] mrjaydee82:
Out of memory error now...FML ...I need to build a new computer
[Nexus 6P Android Development] mohammed510:
Not sure if this is related but I had the same error when I was using 8gb ram. This error when away when I upgraded to 12gb ram.
[Nexus 6P Android Development] chopt51:
I got that too and gave up. Could build 6.0 but have to upgrade my machine to build 7.0
[Nexus 6P Android Development] mrjaydee82:
It probably is..gonna end up building a new computer
[Nexus 6P Android Development] kipue:
Grats :D
[Nexus 6P Android Development] drdrewdown:
Slightly off topic but watching y'all gave me the urge... #StayDirty

[IMG="staydirty"]https://pbs.twimg.com/media/CsrU3qSUkAEYHje.png:large[/IMG]
[Nexus 6P Android Development] masInvasion:
I also had an out of memory error using 4gb ram on virtual machine. There is a way to fix this by lowering simultaneous instances of jack server. I'm very new to this and know nothing about building from source. The error happened to me today but didn't have time to fix it. When researching I found a google android developers webpage with info to fix issue. It said to edit setting in .jack file. Couldn't find it and ran out of time and figured maybe it was installed somewhere else because of the auto script that OP created but don't know. Hoping to fix issue tomorrow. Hope that helps.

Here found link about .jack

https://source.android.com/source/jack.html#$home_jack_file
[Nexus 6P Android Development] sthbr82:
That's a great build time. Mine takes close to 5hrs!

BTW looks like OMS commits still needs to get merged as Substratum is running in legacy mode.
[Nexus 6P Android Development] 1112ee:
Did the name get changed again or just a commit error?

https://github.com/PureAndroidProject 404's
[Nexus 6P Android Development] AzraelsKiss:
http://xdaforums.com/showthread.php?p=68675629 as linked in the OP.

Have a good one!

---------- Post added at 10:01 PM ---------- Previous post was at 09:54 PM ----------

https://github.com/PureNexusProject/ seems to have returned for now... lol
[Nexus 6P Android Development] nathanchance:
Yeah, we are back to PureNexusProject for Github and I think it will stay that way hahaha.
[Nexus 6P Android Development] MrBrady:
Awesome to see this thread, even though I'm still on Shamu. From what I have seen, some people are able to build for Shamu, even though Android N hasn't been released for the device. Any tips on setting up a Shamu build?
[Nexus 6P Android Development] 1112ee:
Do I need to change anything to rebuild since the repo name changed again?
[Nexus 6P Android Development] nathanchance:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
[Nexus 6P Android Development] snak3ater:
[MENTION=6842057]nathanchance[/MENTION] .. Nice to see a thread explaining everything in details regarding Aosp build compilation. Really good for people who are new to this thing. When Nougat sources were released, its compilation was such a big headache because of my build machine with 2Gb ram. Btw now building rom with 8Gb ram ?

All the discussion and proper fixes are at one place here in this thread. Good for all the users who want to compile build themselves.

Great job ☺
[Nexus 6P Android Development] dbarrett480:
Thanks for posting this! I successfully built my first ROM! So now I wanna customize it. I would like to add v4a and magisk and stuff. Anyone have a tutorial for that? I found tons of build tutorials but none that really go into customizing the rom.
[Nexus 6P Android Development] nathanchance:
Glad you think so, appreciate it much :) hopefully you'll hang around with us haha.

So for stuff like that, you'd want to add those things to the vendor/nexus folder. Take a look at the SuperSU commit to get an idea of how to add packages to flash: https://github.com/PureNexusProject...mmit/0f9031c36edc8d0b0507936b60c8f3fd8bdf3b25
[Nexus 6P Android Development] kyle_el:
The feels when you FINALLY get a working build going and installed on your 6P! This is my first time building a custom ROM from git so thanks to everyone on this thread for all your help, I really could not have done it without you :highfive: #happycrying
[Nexus 6P Android Development] drdrewdown:
congrats! :cheers:
[Nexus 6P Android Development] dbarrett480:
Thanks! So if I'm understanding correctly I would just make modifications to the individual files within the source folders for example, build.prop? Then I could add system apps by just putting the apk into the system/apps folder or whatever. Then when I build it includes my customized files? I know that's a very general overview but is that basically how it works?

---------- Post added at 05:43 AM ---------- Previous post was at 05:40 AM ----------

And then for flash able zips I would add them to the folders that are in that commit and then add those lines to the config files right?
[Nexus 6P Android Development] nathanchance:
Generally yes haha.
[Nexus 6P Android Development] nathanchance:
Congratulations!
[Nexus 6P Android Development] hi4s4:
Can you elaborate how to remove it (android-sdk). Also, do we need to sync it with the repo in the first place?

Thanks,
[Nexus 6P Android Development] 1112ee:
I'm trying to build again, but I'm getting command not found when using brunch or breakfast. I even deleted the pure folder and started from the beginning and still command not found. Any ideas?

Could it be related to the name changing again? I did repo init -u https://github.com/PureNexusProject/manifest.git -b n
[Nexus 6P Android Development] nathanchance:
Beans is changing some stuff in the vendor/build repo so I'd hold tight for a bit.
[Nexus 6P Android Development] fkfmfz:
If some of you guys are getting a error from build/core/main.mk file... Comment out line 230 by adding a # in front
[Nexus 6P Android Development] qsec:
Is there still updating going on in the repo?

I got error 'no such file or directory' when running . /build/envsetup.sh

Thanks
[Nexus 6P Android Development] 1112ee:
Yeah pretty it's still being worked on.
[Nexus 6P Android Development] kipue:
Do you type it that way exactly?

looks like you got an extra slash in there.

Should it be : . build/envsetup.sh

instead? I had that error when I forgot the space after the full stop
[Nexus 6P Android Development] nathanchance:
Make sure it is . build/envsetup.sh not . /build/envsetup.sh. If that doesn't work, then yes, it is still a WIP.
[Nexus 6P Android Development] qsec:
Ok, thanks.

Is there a way to know when its done, can i see it somewhere?

---------- Post added at 10:38 AM ---------- Previous post was at 10:36 AM ----------

i used . build/envsetup.sh

thanks.
[Nexus 6P Android Development] nathanchance:
Force sync again, just tried and it worked fine.
[Nexus 6P Android Development] qsec:
Syncing right now :)