yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Uldiniad:
I already told you what's happening and how to fix it in my first reply to you. I won't repeat myself.
[Android Software/Hacking General [Developers Only]] madper:
My word of advice, this guide is indeed works, if you encounter any issue, please re-read again each step and pay close attention to the detail in case you miss something, and redo the step again.

For op, maybe it is wise to add step to verify that environment is ready for build process, for example checking for java sdk version installed, check whether environment variable is set, etc.
[Android Software/Hacking General [Developers Only]] decentguy49:
I followed your steps and even then I was having issue that's why i said that buddy.

Another question, will this guide work for LineageOS 14.1 too also?
[Android Software/Hacking General [Developers Only]] Uldiniad:
I understand that you're running into the exec error again. But I guarantee you wouldn't have it if you did everything correctly. You're having that error because you're using the prebuilt bison which is 32-bit and wsl does not support 32-bit binaries. If you make bison on a 64-bit system it will generate the 64-bit bison binary you need. You must point to the generated 64-bit bison binary using BISON_EXEC (add it to bashrc if you don't want to have to keep manually setting BISON_EXEC every time you open a new terminal). And make sure you repopick wsl-compile every time you repo sync. Everything I've said here is on the OP. I don't want to repeat myself again. If you still don't get it after this, I cannot help you.

Concerning cm-14.1, I have not backported my patches and I am not interested in supporting older versions. I plan on supporting only the latest version of lineage available. My patches are available on gerrit, feel free to backport them if you want. Though I don't think my patches will work without modifications on cm-14.1. Main thing you'd be looking for is using 64-bit binaries and then patching whatever else crashes because of wsl (for example, on lineage-15.1, ijar causes issues, so it needed patching).
[Android Software/Hacking General [Developers Only]] Jiiro:
[MENTION=7350242]Uldiniad[/MENTION]

Thank you for this amazing guide, I will be trying this out as I am a new developer. I have gotten Ubuntu 16.04 LTS (the one that didn't say any numbers in the title in the Microsoft Store). I think Ubuntu 16.04 LTS should be okay, right? You pointed out Ubuntu 18.04 LTS but I went for the older version, please respond if that doesn't cause an issue and how to update it. Thanks!
[Android Software/Hacking General [Developers Only]] Uldiniad:
It should be fine. We used to use that before 18.04LTS was released. I always recommend using the latest LTS, that's all.
[Android Software/Hacking General [Developers Only]] Jiiro:
Do you happen to have Discord?
[Android Software/Hacking General [Developers Only]] Uldiniad:
I only take support requests relating to build failures caused by the wsl build environment in this thread or via XDA direct messaging. I prefer the thread because with the amount of posts, I'm sure that many answers for questions from newcomers can be found by searching here.
[Android Software/Hacking General [Developers Only]] decentguy49:
Hi,

I started from scratch and followed every step and now got following error after repo sync -
[Android Software/Hacking General [Developers Only]] Uldiniad:
looks like you've made changes to the files and they are running into merge conflicts. if you don't care about any changes you've made run

repo forall -vc "git reset hard"
[Android Software/Hacking General [Developers Only]] Uldiniad:
wsl-compile is now officially merged

Hey everyone,

some good news to share today, the wsl-compile patches (https://review.lineageos.org/#/q/st...d_build+branch:lineage-15.1+topic:wsl-compile) have now been merged and so it will no longer be necessary to cherrypick them.

One less thing to think about when building on wsl.

I'm looking into making it more convenient, but I cannot guarantee anything more at the moment. This might be as good as it gets for us since mac users (mac has lots of patches but is officially supported by aosp so...) also have to set BISON_EXEC for example.

Happy building,

Uldiniad
[Android Software/Hacking General [Developers Only]] :
stuck after step 6!

So I tried following your guide & after step 6 (directory made) I got this:

E: Unable to locate package https://github.com/LineageOS
E: Couldn't find any package by glob 'https://github.com/LineageOS'
E: Couldn't find any package by regex 'https://github.com/LineageOS'
E: Unable to locate package lineage-15.1
E: Couldn't find any package by glob 'lineage-15.1'
E: Couldn't find any package by regex 'lineage-15.1'
[Android Software/Hacking General [Developers Only]] Uldiniad:
Looks like you ran apt instead of repo init?
[Android Software/Hacking General [Developers Only]] zseoer:
Thanks for posting the tutorial
[Android Software/Hacking General [Developers Only]] decentguy49:
Hi,

after running make bison && make ijar, got this error
[Android Software/Hacking General [Developers Only]] Uldiniad:
probably a problem with the device tree again. see similar issue here: https://stackoverflow.com/questions...hared-libraries-libjpeg-already-defined-error
[Android Software/Hacking General [Developers Only]] Uldiniad:
Want a piece of Pie?

Hey everyone, got some news to share.

As you may have heard, the Pie is now out of the oven. Given that,

1. At the moment building android on WSL is 100% experimental

2. There seems to be little to no interest from Google and Microsoft to officially support wsl as an android build environment

3. I'm working alone with limited time and knowledge of both the android build environment and the inner workings of wsl

4. I plan on supporting the latest version of lineage available

I am therefore starting research and work on lineage-16.0 and will be leaving lineage-15.1 as it currently stands.

As windows updates come, wsl will change and may bring new unforeseen errors to the oreo build environment. Since I will not be maintaing that branch anymore, it may mean that the best option to keep building 15.1 is to not update to the latest build of windows if it causes errors. Given this situation I will be paying less attention to bug reports for 15.1 as time goes by and 16.x takes its place (especially since I do not have 15.1 synced anymore and will not be able to reproduce errors).

For 16.x, it entails I will proceed to ram my head into the wsl wall until it gives up or I do.

Hoping we'll all get a piece of the Pie,

Uldiniad
[Android Software/Hacking General [Developers Only]] Uldiniad:
In the out directory. If you source build/envsetup.sh, you can probably use cd $OUT

Also note that the guide in its current state is under construction since I'm aiming to start building for 16.0. If you're building for 15.1 in builds before 17713 then I can assist. After that windows build they made changes to wsl that currently causes the build environment to hang
[Android Software/Hacking General [Developers Only]] Uldiniad:
You can maybe use something in the out directory for the emulator in android studio. But I've never tried it so you'll probably find more help for that elsewhere
[Android Software/Hacking General [Developers Only]] Uldiniad:
You must not have understood what I said in one of my replies to you. The guide in its current state is not ready, it is a work-in-progress concerning 16.0. You can only build 15.1 on builds <= 17713 of Windows at the moment. I;m working on getting builds beyond that working too for both Oreo and Pie.

You don't have to mkdir again. Once repo init is set up you only need to repo sync. If you disconnect, launching repo sync again will just go back to where it last left off (it would be a pretty useless tool otherwise). I already told you where to find the rom itself. Also most of your questions are answered on the official LineageOS wikis.
[Android Software/Hacking General [Developers Only]] knaik95:
Hey, I'm trying to build LOS-16 (on Ubuntu but I don't think that makes a difference... does it?) and this happens

build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_kltedv".

I have all the device tree files and everything in place from when I build 15.1. Are there any changes I need to make to get this to work?
[Android Software/Hacking General [Developers Only]] Uldiniad:
1. my previous posts should make it clear that 16.0 is WIP and experimental. Keep using 15.1 until it is no longer WIP or don't report crashes if you do try it (if you find or fix something you can upload it to gerrit).

2. https://github.com/LineageOS/android_device_samsung_kltedv no 16.0 branch
[Android Software/Hacking General [Developers Only]] knaik95:
I set lineage-15.1 to be the fallback branch when the code searches for a 16 branch and doesn't find one. Does that not make a difference?
[Android Software/Hacking General [Developers Only]] Uldiniad:
if you repo init to 16.0 maybe not. I wouldn't mix and match 15.1 and 16.0 though. if a 16.0 branch isn't out yet, there's a reason.

anyways, 16.0 came out just some days ago and bringup for all devices has barely begun if at all. I don't recommend making builds for devices until bringup is at least started. build environment is being worked on at the moment afaik
[Android Software/Hacking General [Developers Only]] Skrifoxx:
this appeared: curl: (22) The requested URL returned error: 404

question #2: i'm using ubuntu 18.04 it doesn't matter right :confused:
[Android Software/Hacking General [Developers Only]] Uldiniad:
As on OP, I recommend 18.04.

can you give more info about the curl error? context? command executed?
[Android Software/Hacking General [Developers Only]] :
Do I need prior rom building knowledge to do this? All I've been able to do thus far is take apart my stock rom and edit stuff. I'd love to be able to build a full custom rom from scratch. Is there a step by step to accompany this tutorial?
[Android Software/Hacking General [Developers Only]] Skrifoxx:
yes i can .

well when i executed "repo sync'' it gave me a semi-bucle and the process has never finished ... i wait half day:( .. and nothing.. context : sorry .. i'm not in my house .. just wait a little bit of time later on i'll take it
[Android Software/Hacking General [Developers Only]] Uldiniad:
Not really. I mean. I started two years ago completely ignorant. Now I know a thing or two. If you're good at learning by yourself and googling a lot, then you're fine. If you follow this guide (for 15.1, as 16.0 is not ready for wsl) you would have a flashable zip of lineage for the target you specify. The only resource I recommend maybe beside this guide is LineageOS wiki and Android wiki too
[Android Software/Hacking General [Developers Only]] Uldiniad:
Does it hang every time you execute repo sync?
[Android Software/Hacking General [Developers Only]] :
That's awesome, I'm going to have a go at it. You aren't by chance on Telegram are you? It's always nice to bounce questions off somebody that knows a thing or two, lol. Mostly little things, like you mention the device codename and such. My question would be where do I find that?
[Android Software/Hacking General [Developers Only]] IDisposable:
I'm on Windows 10 Insider Preview 17741.1000 (rs5_release) and just did full

repo sync

and build of OnePlus2 from scratch with no problem. I'm in the habit of regularly doing a

sudo apt-get update && sudo apt-get upgrade

before starting the sync, maybe that will help others?

Oh and the build took 39 minutes to complete, so reasonably quick. I have the Ubuntu directory excluded from Windows Defender and an SSD
[Android Software/Hacking General [Developers Only]] hanbin81j32:
hi. i build lineageOS for my Mi5 (gemini) but it has error. how to fix?

** Don't have a product spec for: 'lineage_gemini'

** Do you have the right repo manifest?
[Android Software/Hacking General [Developers Only]] Uldiniad:
I don't have Telegram. For android dev purposes I'm only available through this website. As I've said, you'll probably find lots of answers on the LineageOS wiki (https://wiki.lineageos.org/) and maybe on Android wiki too (https://source.android.com).
[Android Software/Hacking General [Developers Only]] Uldiniad:
If you keep updating your previews lemme know if it continues working. I've had hangs on

make

starting with RS5 previews. I wonder if it is the Windows defender as you mentioned.
[Android Software/Hacking General [Developers Only]] Uldiniad:
Did you repo init 16.0 or 15.1? what command did you execute that gave you that output?
[Android Software/Hacking General [Developers Only]] hanbin81j32:
16.0. now i fix this problem..

but it has other error too..

now I try Repo sync.. but it has error too..

swipe@DESKTOP-OKMMS8F:~/android/lineage$ repo sync

Traceback (most recent call last):

File "/home/swipe/android/lineage/.repo/repo/main.py", line 531, in <module>

_Main(sys.argv[1:])

File "/home/swipe/android/lineage/.repo/repo/main.py", line 507, in _Main

result = repo._Run(argv) or 0

File "/home/swipe/android/lineage/.repo/repo/main.py", line 158, in _Run

copts, cargs = cmd.OptionParser.parse_args(argv)

File "/home/swipe/android/lineage/.repo/repo/command.py", line 67, in OptionParser

self._Options(self._optparse)

File "/home/swipe/android/lineage/.repo/repo/subcmds/sync.py", line 189, in _Options

self.jobs = self.manifest.default.sync_j

File "/home/swipe/android/lineage/.repo/repo/manifest_xml.py", line 360, in default

self._Load()

File "/home/swipe/android/lineage/.repo/repo/manifest_xml.py", line 423, in _Load

nodes.append(self._ParseManifestXml(local, self.repodir))

File "/home/swipe/android/lineage/.repo/repo/manifest_xml.py", line 443, in _ParseManifestXml

root = xml.dom.minidom.parse(path)

File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse

return expatbuilder.parse(file)

File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse

fp = open(file, 'rb')

IOError: [Errno 13] Permission denied: '/home/swipe/android/lineage/.repo/local_manifests/roomservice.xml'
[Android Software/Hacking General [Developers Only]] Uldiniad:
it says what the issue is. your roomservice.xml does not have read permissions. change that with chmod
[Android Software/Hacking General [Developers Only]] Skrifoxx:
yes does it and i don't know why.. sorry i'm noob on this and i really want to learn this and build my own zip archive

i reload the terminal and i'm gonna start again whether i have another problem i hope that you may help me
[Android Software/Hacking General [Developers Only]] pengu0:
Hi!

I have same device and I get the same error.

Here's the command I ran:

breakfast gemini

after running that command I got this error:

device/xiaomi/msm8996-common/BoardConfigCommon.mk:186: error: device/qcom/sepolicy/sepolicy.mk: No such file or directory

and and the end of terminal there was this message:

** Don't have a product spec for: 'lineage_gemini'

** Do you have the right repo manifest?

thanks!
[Android Software/Hacking General [Developers Only]] hanbin81j32:
thanks. i fix it. but now. i has other bug too :( in make bison command. how to fiix..?

swipe@DESKTOP-OKMMS8F:~/android/lineage$ make bison

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=9

TARGET_PRODUCT=aosp_arm

TARGET_BUILD_VARIANT=eng

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a-neon

TARGET_CPU_VARIANT=generic

HOST_ARCH=x86_64

HOST_2ND_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-4.4.0-17134-Microsoft-x86_64-Ubuntu-18.04.1-LTS

HOST_CROSS_OS=windows

HOST_CROSS_ARCH=x86

HOST_CROSS_2ND_ARCH=x86_64

HOST_BUILD_TYPE=release

BUILD_ID=PPR1.180610.009

OUT_DIR=/home/swipe/android/lineage/out

============================================

ninja: error: 'Android.bp', needed by '/home/swipe/android/lineage/out/soong/.bootstrap/build.ninja', missing and no known rule to make it

18:48:55 soong minibootstrap failed with: exit status 1

build/make/core/main.mk:21: recipe for target 'run_soong_ui' failed

make: *** [run_soong_ui] Error 1
[Android Software/Hacking General [Developers Only]] Uldiniad:
I don't know how many times I have to say WIP and not ready for people to understand. 16.0 on wsl is not ready. Please don't post build errors until I say otherwise. I'm working on these things and aware of many levels of failures. I do have a question though: did you repo init on top of 15.1? Or was it a clean sync?
[Android Software/Hacking General [Developers Only]] Uldiniad:
I'm assuming you're on 16.0 which is not a functional build environment at the moment on wsl. Can't state it enough times. Did you do a clean sync or did you init on top of 15.1?
[Android Software/Hacking General [Developers Only]] Uldiniad:
what build of windows are you on? does it happen on reloading? where you syncing 16.0 on top of 15.1 or clean syncing?
[Android Software/Hacking General [Developers Only]] pengu0:
I dual booted ubuntu and did clean sync.
[Android Software/Hacking General [Developers Only]] Uldiniad:
Were you using wsl before? This thread is for wsl only. I don't want people wasting my time with other build environments. For issues with native Ubuntu go post elsewhere
[Android Software/Hacking General [Developers Only]] pengu0:
Yes I was using wsl and I got same error that I got in wsl. I will try syncing again today.
[Android Software/Hacking General [Developers Only]] Uldiniad:
Then it is just not ready for building at all. Patience will be the solution here
[Android Software/Hacking General [Developers Only]] Skrifoxx:
I'm not on Windows .. i'm working on ubuntu 18.04 the latest build even though I have Windows and it has the latest update
[Android Software/Hacking General [Developers Only]] Uldiniad:
If you're working on native ubuntu on dual-boot, as I've said before, stop wasting my time. If you're on 18.04 on wsl on Windows then it's fine and if so, I am asking for the build number (latest update doesn't mean much since previews exist)
[Android Software/Hacking General [Developers Only]] RadixCube:
i'm also hanging on dex2oat

can you please tell me how to run it with multi-threading disabled?

(I've already tried make -j1 and bacon -j1)
[Android Software/Hacking General [Developers Only]] Uldiniad:
the patch is already merged on official 15.1, you should not have the issue. I have not ported it to 16.0 but it is not ready at all (why I've tagged the thread WIP)
[Android Software/Hacking General [Developers Only]] RadixCube:
Thanks for the quick reply.

I'm building 8.1.0 aosp rom.

Found the commit in los 15.1 branch thanks a ton!!
[Android Software/Hacking General [Developers Only]] Zenns:
Hi

I have tried the above but once I did repo sync it is stuck at checkout and I left my laptop for 12 hours and was stuck there I have a 16 GB Ram with HDD 1TB and 1GBPS LAN Point ? Using Windows 1803 64 Bit, is there something wrong ??
[Android Software/Hacking General [Developers Only]] Uldiniad:
Does it happen every time you sync? Sometimes my terminal doesn't refresh, I select it, press ctrl+c and it refreshes
[Android Software/Hacking General [Developers Only]] Zenns:
I tested on normal ubuntu and it works fine but it fails on wsl
[Android Software/Hacking General [Developers Only]] Uldiniad:
sure, but you didn't answer my question, does it happen every time? also what windows build are you on?
[Android Software/Hacking General [Developers Only]] Zenns:
Hey sorry mate I did it twice and it happened im on 1803 Windows 10 x64 Single Lang Home
[Android Software/Hacking General [Developers Only]] Uldiniad:
No insider preview build then? what branch were you trying to sync? 16.0 is WIP. were you syncing on top of another branch or from scratch? did you modify the roomservice.xml or hadn't gotten there yet?
[Android Software/Hacking General [Developers Only]] IDisposable:
Windows 10 Insider Preview 17746.1000 (rs5_release) built fine (still 15.1) in 35:41
[Android Software/Hacking General [Developers Only]] Uldiniad:
I'm on 18219. might have been introduced later.
[Android Software/Hacking General [Developers Only]] Sahil_Sonar:
Once its done what command I am supposed to type in order to get the build zipped one. :o New with builds.
[Android Software/Hacking General [Developers Only]] Uldiniad:
brunch is the building command. but I'm not sure what you're asking. 16.0 is not ready btw, 15.1 works on most recent builds of windows (can't confirm all since I've been running into hangs on the latest skip ahead previews). you can follow the guide here but you'll need to make ijar and point to it for 15.1
[Android Software/Hacking General [Developers Only]] Sahil_Sonar:
I mean after I have build the ROM where it will be as I am using WSL so I am not sure about the directory, Which command to use to get to the build ROM ? Out like that.
[Android Software/Hacking General [Developers Only]] Uldiniad:
same as native Ubuntu. easiest way should be cd $OUT (will only work if you source buildenvsetup.sh)
[Android Software/Hacking General [Developers Only]] Sahil_Sonar:
What about local manifest ? Also I want to make for Mediatek. and device vendor tree ?
[Android Software/Hacking General [Developers Only]] Uldiniad:
I can't help you with everything. You'll have to find out some stuff on your own. Googling will help. The local manifest is generated by breakfast and you should add the proprietary blobs to it as specified on the guide.
[Android Software/Hacking General [Developers Only]] matssa:
Hey I'm regularly getting issues when building, it sometimes can't seem to load shared libraries like libc++.so. After launching it a second time, it sometimes works, sometimes not... Any ideas what I can do to make it work fully?

Thanks for your help and guidance :)
[Android Software/Hacking General [Developers Only]] Uldiniad:
what build of windows are you on? what branch of lineage is this happening on? are you sure you're pointing to the bison you are making and not the prebuilt one?
[Android Software/Hacking General [Developers Only]] matssa:
I'm on Windows 1803, build AICP (fork of LineageOS) android 8.1. For bison, I added in .bashrc

export BISON_EXEC=~/android/system/out/host/linux-x86/bin/bison

export IJAR_EXEC=~/android/system/out/host/linux-x86/bin/ijar

This should make it use the correct one I hope.
[Android Software/Hacking General [Developers Only]] Uldiniad:
did you make bison (you're pointing to it correctly, but if the file isn't made it won't work :P)? also, does AICP have the wsl-compile topic merged? not windows insider preview build?
[Android Software/Hacking General [Developers Only]] matssa:
Yeah bison is made when a make clobber is made (I'm made a full building script that takes everything in consideration ;) ). AICP did merge the wsl topic, and even before I was cherry-picking from lineage.

For Windows, f***, I think I'm on the insiders... Dunno how the f*** I'm on that, any way to get away from that? EDIT/// Nvm, my account seems to be enabled, but not my Windows PC (sigh).
[Android Software/Hacking General [Developers Only]] matssa:
Btw, does breakfast still overwrite the roomservice.xml? On my side, it doesn't overwrite anymore :S
[Android Software/Hacking General [Developers Only]] Uldiniad:
it shouldn't should only do create the file the first time
[Android Software/Hacking General [Developers Only]] Uldiniad:
I'm kinda lost then. The issues with libc++ where happening to me when I was not using the made bison. I'll look at some previous posts see if others had any other issues, workarounds, fixes or suggestions
[Android Software/Hacking General [Developers Only]] matssa:
Even when the branches changes? When I was on CM14.1, it was always regenerated when making breakfast.

Ok thanks. Furthermore, it doesn't happen all the time. When I don't make clobber, no issues mostly. When I make clobber, I usually get the error 1 or 2 times, even though bison is made and all. Really strange... It's almost like it has too much work to do and it craps out somewhere.