repo init error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

repo init error

9,483 Views
shamiullah
Contributor III

Hello @all,

when i running repo init command i am facing the following issues for android 10 source.

ERROR:

-----------------------------------------------------------------

Start fetching the source for android build
Setting REL_PACKAGE_DIR to /home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0
Setting WORKSPACE to /home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0
Setting android_builddir to /home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build
Downloading Repo source from https://gerrit.googlesource.com/git-repo
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
---------------------------------------------------
-----Repo Init failure
---------------------------------------------------
./imx_android_setup-ALPHA1.sh: line 66: return: can only `return' from a function or sourced script
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
Try repo sync 1 time(s)
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
Try repo sync 2 time(s)
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
Try repo sync 3 time(s)
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax
---------------------------------------------------
------Repo sync failure
---------------------------------------------------
./imx_android_setup-ALPHA1.sh: line 88: return: can only `return' from a function or sourced script
fatal: can't open patch '/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/device/fsl/imx8m/phyboard_polis/patch/0001-imx8mm_bl31_setup-allow-uart4-from-A53-processor.patch': No such file or directory
fatal: can't open patch '/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/device/fsl/imx8m/phyboard_polis/patch/0001-Parsing-the-devicetree-name.patch': No such file or directory
Android source is ready for the build

-----------------------------------------------------------------

 

 

With Regards,

Shamiullah

0 Kudos
Reply
6 Replies

9,463 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

@shamiullah 

 

It seems your git doesn't have a correct config.Can you attach your all commands?

0 Kudos
Reply

9,453 Views
shamiullah
Contributor III

Hi @Zhiming_Liu 

The above issue got resolved by downlaoding gitconfig but i am facing other issue

Below are the logs:

-------------------------------------------------------------------------------------------------------------------------------------------prasanth@phytec1:~/shammi/android10/imx-android-10.0.0_2.0.0/android_build$ repo init -u https://stash.phytec.com/scm/asdk/platform-manifests.git -b imx-android-10 -m ALPHA1.xml
prasanth@phytec1:~/shammi/android10/imx-android-10.0.0_2.0.0/android_build$ /usr/bin/repo init -u https://stash.phytec.com/scm/asdk/platform-manifests.git -b imx-android-10 -m ALPHA1.xml
File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/android_build/.repo/repo/main.py", line 79
file=sys.stderr)
^
SyntaxError: invalid syntax
prasanth@phytec1:~/shammi/android10/imx-android-10.0.0_2.0.0/android_build$ ~/bin/repo init -u https://stash.phytec.com/scm/asdk/platform-manifests.git -b imx-android-10 -m ALPHA1.xml

-----------------------------------------------------------------------------------------------------------

When i use repo binary downloaded by the curl commands i am getting any error but it is taking less time to execute the command as shown above

When i use repo binary from /usr/bin/ , i am facing the following issue as shown below

File "/home/prasanth/shammi/android10/imx-android-10.0.0_2.0.0/.repo/repo/main.py", line 79
file=sys.stderr)
^
SyntaxError: invalid syntax

 

I downloaded the repo by using the below commands

$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin

 

Please let me know

Thanks & Regards

Shamiullah

0 Kudos
Reply

5,775 Views
sbhattad
Contributor I

Hello @shamiullah ,

Facing issue while repo init regarding git config. Kindly help me to resolve.

ivi@Jenkins:~/AndroidEmulator$ cat ~/.gitconfig
[user]
email = shraddhabhattad15@gmail.com
name = shraddhabhattad15
ivi@Jenkins:~/AndroidEmulator$ python3 ~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r47
Traceback (most recent call last):
File "/home/ivi/AndroidEmulator/.repo/repo/main.py", line 42, in <module>
from git_config import RepoConfig
File "/home/ivi/AndroidEmulator/.repo/repo/git_config.py", line 774
self._Set(f'superproject.{key}', value)
^
SyntaxError: invalid syntax

0 Kudos
Reply

4,335 Views
cuiliu
NXP Employee
NXP Employee

Facing the same issue. Have resolved it. 

If you still don't know how to solve the issue, maybe you can try this:

It is not related to git_config but to the version of python. Maybe you curl repo with python2 and thus the .repo in you Android folder is false. You can do this to fix it:

1, change your python version

$ sudo update-alternatives --config python 

then enter number of python3

$ python --version

if display python3***,is right

 

2,remove your repo

$ which repo

$ sudo rm -rf /home/***/bin/repo

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=${PATH}:~/bin

 

3,remove .repo in android folder

$ sudo rm -rf  android_forder/.repo

 

3,At last,you can repo init successfully

0 Kudos
Reply

9,354 Views
IgorKorolyuk
Contributor I

Hello, @shamiullah .

I'm facing the same issue.
Can you please add details on "downlaoding gitconfig", I don't seem to understand what it is exactly and the way it helps.

Thank you.

0 Kudos
Reply

9,422 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Do you input correct xml?Your input xml name is (imx-android-10 -m ALPHA1.xml), it contains spaces.

0 Kudos
Reply