Can not do repo init for Android Pie

Hello,

I am not able to do repo init. I am getting the following error.

Output:

Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 1, done
remote: Finding sources: 100% (30/30)
remote: Total 30 (delta 2), reused 30 (delta 2)
Unpacking objects: 100% (30/30), done.
From https://gerrit.googlesource.com/git-repo
7f7acfe…5e2f32f main -> origin/main
4b32581…352c93b stable -> origin/stable

  • [new tag] v2.10 -> v2.10
    Traceback (most recent call last):
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/main.py”, line 56, in
    from subcmds.version import Version
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/subcmds/init.py”, line 38, in
    [’%s’ % name])
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/subcmds/upload.py”, line 27, in
    from hooks import RepoHook
    File “/media/parth/BSP_Storage/vim3_sdk/.repo/repo/hooks.py”, line 472
    file=sys.stderr)
    ^
    SyntaxError: invalid syntax

This is urget. Can anybody tell me the solution?

This appears to be a question not regarding the VIM3 but more Linux in general.
Suggest you try at askubuntu.com or similar for the O/S your working with.

1 Like

@JustSumDad its android building question to be precise, but yes, the approach is true

@Parth you better check on some Android forums, or the android discord server, if you really want faster response to your questions based on android building, or check on stackoverflow,
those are the best places you can find answers quick :slightly_smiling_face:

1 Like

I am not trying to build the source code but just trying to init the repo of Android Pie for VIM3. I am trying to download the SDK for VIM3.

Command ----> repo init -u https://github.com/khadas/android_manifest.git -b khadas-vims-pie

@JustSumDad @Electr1
Solved this problem by downloading the latest version of Repo.
Thanx

2 Likes

Hi Parth, how do you get the last version?
I updated today but the error is still there.

Thanks, Juan.

did you configure your environment before building ?

Python-related error

1 Like

Hi Boudour,
I try this but nothing different happened.

I think, like taimed said, is related with Python, this is the log
image

Any suggest?
Thank you for your help.
Regards, Juan.

try to configure your environment

$ sudo apt-get install repo
$mkdir ~/bin
$PATH=~/bin:$PATH
$curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$chmod a+x ~/bin/repo

$ sudo apt-get install git gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g+±multilib libc6-dev-i386 lib32ncurses-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig ccache u-boot-tools
see this https://source.android.com/setup/develop

after that check if you are using python 3 if no so install it there is a problem with python

4 Likes

delete the /home/bin folder a,nd reinstall the repo again

python3 + instruction
ie:
python3 repo init …

2 Likes

Yes, you are trying to run python 3 files in python 2 environments.

I followed three steps to solve this issue. Let me give you the steps.

  1. Download the last version of repo: curl https://storage.googleapis.com/git-repo-downloads/repo-1 > repo

  2. Change right to make it executable: chmod a+x repo

After these two steps add ‘repo’ in the local path.

  1. Run your repo init with python3 and the “repo” you just download: python3 repo init -u https://github.com/khadas/android_manifest.git -b khadas-vims-pie

Let me know if this works for you or not.

3 Likes

I follow the steps and it works like charm!
Thank you Boudour, taimed and Parth!

Regards, Juan.

6 Likes

I spent 3 hours on this topic and finally found these command works for me.

My python3 is Python 3.6.9 and python is Python 2.7.17 running on Ubuntu 18.04.

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

sudo apt-get install ca-certificates
sudo update-ca-certificates --fresh
sudo apt install python2
sudo update-alternatives --install /bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /bin/python python /usr/bin/python2.7 2
sudo update-alternatives --config python //choose 2
mkdir ~/bin
PATH=~/bin:$PATH
curl -k https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x repo 
git config --global user.name "xxx"
git config --global user.mail"xxx@xxx.com"
mkdir ./workspace
cd workspace
which repo
wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.bz2
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
sudo mkdir /opt/toolchains
sudo tar -xjf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.bz2 -C /opt/toolchains
sudo tar -xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt/toolchains
wget https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz
wget https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
sudo tar xvJf gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz -C /opt/toolchains
sudo tar xvJf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains
cd workspace/
ls -al
mkdir vim3
cd vim3
wget https://github.com/git-lfs/git-lfs/releases/download/v2.3.4/git-lfs-linux-amd64-2.3.4.tar.gz
tar xvzf git-lfs-linux-amd64-2.3.4.tar.gz
cd git-lfs-2.3.4
git init
git config http.sslVerify false
sudo ./install.sh
cd ..
mkdir bsp
cd bsp
export PYTHONHTTPSVERIFY=0
repo init -u https://github.com/khadas/android_manifest.git -b khadas-vims-pie
repo sync -j4
cd bsp/
cd bootloader/uboot/
./mk kvim3 
cd ..
cd ..
cp bootloader/uboot/build/tools/mkimage ~/bin/mkimage
chmod +x ~/bin/mkimage
cd ..
source build/envsetup.sh 
lunch kvim3-userdebug
make -j2 otapackage

[Reference cmd]
sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g+±multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev git-core python3.8 libncurses5

Hope my sharing could help you :slight_smile:
My VM used to build vim3 only takes 259 GB.

4 Likes

I follow the steps and it works! (only revise two instructions below)
Thank you ChiaHungMou :slight_smile:

sudo update-alternatives --install /bin/python python /usr/bin/python3.6 1
sudo update-alternatives --install /bin/python python /usr/bin/python2.7 2

1 Like

Yes, it works. This is a python issue.

1 Like

Thanks a lot, above set of commands related to Python worked for me.