close

[Solved] SyntaxError: invalid syntax to repo init in the AOSP code

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error SyntaxError: invalid syntax to repo init in the AOSP code in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How SyntaxError: invalid syntax to repo init in the AOSP code Error Occurs?

Today I get the following error SyntaxError: invalid syntax to repo init in the AOSP code in Python.

How To Solve SyntaxError: invalid syntax to repo init in the AOSP code Error ?

  1. How To Solve SyntaxError: invalid syntax to repo init in the AOSP code Error ?

    To Solve SyntaxError: invalid syntax to repo init in the AOSP code Error try these commands
    curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
    chmod a+x ~/bin/repo
    python3 ~/bin/repo init -u [email protected]….

Solution 1


try these commands

curl https://storage.googleapis.com/git-repo-downloads/repo-1 > ~/bin/repo
chmod a+x ~/bin/repo
python3 ~/bin/repo init -u [email protected]

Solution 2

I just had the same issue and this resolved it for me :

  • Download last version of repo : curl https://storage.googleapis.com/git-repo-downloads/repo-1 > repo
  • Change right to make it executable : chmod a+x repo
  • Run your repo init with python3 and the “repo” you just download : python3 repo init -u [email protected]:xxx/xx_manifest.git -b xxx

Solution 3

As seen in a similar error in arvestad/alv issue 1, that would be consistent with running the process with Python 2.7 instead of Python3

Double-check you Python version between:

  • your Ubuntu build machine (where the repo init works)
  • your VM Ubuntu machine (where the repo init fails)

Same error here, with the error suggesting you are executing python2 with a PYTHONPATH that’s only appropriate for python3.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment