Need help building GSI

I have used the build process I have gotten from @Phie :

git clone .repo/local_manifests

repo init -u -b v1-pie

repo sync -j2


But I’m always stuck at the same point with an python error

File “build/make/tools/”, line 51
except getopt.GetoptError, err:
SyntaxError: invalid syntax

The ‘normal’ build are working on the same machine, so it’s not a system setup error. And I have tried with python 2.6.x and 3.x.x

Now I need help to resolve this issue. My python knowledge is very, very small :frowning:

Edit the line in python to this:

except getopt.GetoptError as err:

thx, will try…

after changing, next file running into the same error. After making the same changes, the following part runs in error

opts, args = getopt.getopt(sys.argv[1:], “ho:m:”)
except getopt.GetoptError, err:
print str(err)
print doc

for o, a in opts:
if o == “-h”:
print doc
elif o == “-o”:
output_file = a
elif o == “-m”:
pre_merged_file = a
print >> sys.stderr, “unhandled option %s” % (o,)

I don’t get it. Is something wrong with my python ? I have tried with python 2 and 3, but nothing changed

EDIT: The craziest is, that both files are working on ‘normal’ builds. OK, don’t know if they will used.

The “normal” build switches between Python 2 and 3. I did not investigate why. The errors you got are Python3 errors. Can you switch to Python 2.7?

I do have 2.6 and 3x installed. Must check for 2.7

Normally I’m building with normal user = Python 3.6.9

When building with root (for example with docker) it’s = Python 2.7.17

ich@mint:~$ python -V
Python 3.6.9
ich@mint:~$ sudo su
[sudo] password for ich:
root@mint:/home/ich# python -V
Python 2.7.17

I have start build with root (python 2.7) but same error

File “build/make/tools/”, line 51
except getopt.GetoptError, err:

I guess you need an older version of python.

Lol, old programming version for new OS version building

Agree, better solution would be an updated python script.

on my side I have python 2.7 so I guess this is the needed version for android pie

I’m also building with python 2.7.3. So that’s not the issue. Could it be the Linux distro ??

ubuntu 18.04.4 here :slight_smile:

OK, will try …

works on Ubuntu 18.04

build completed successfully (25:40 (mm:ss))

yes, on my laptop with Ubuntu 18.04 it’s also compiling now. But it will need longer because of USB HD

1 Like

Thanks It works on Ubuntu 18.04.

1 Like

I would like to try building a GSI, but it will need to be on a cloud compute instance as my home setup isn’t up to Android builds yet. The instance will be Ubunbtu 18.04, with all recent updates applied.

Is this process likely to be feasible in that environment? Clearly I will need repo and git installed. Is there any thing else I need to setup, or will the script pull in everything I need?

This script will do everything.

But you have to edit the treble_build_los/ You have to decide which buildvariant you need. make the others as a comment.

Have you seen that I have created eOS Q GSI (Android 10) ?