0

$ repo sync for

Build LMY47V android-5.1.1_r1 Lollipop

results into error:

Fetching projects:  62% (302/486)  Fetching project platform/frameworks/base
fatal: Not a git repository: '/home/ashish/askdnx/.repo/projects/frameworks/base.git'

The repo sync goes on for sometime and then fails with errors.

What could be a fix for this ? Can I use

$ git clone https://android.googlesource.com/platform/frameworks/base.git 
Ashish Krishnan
  • 422
  • 2
  • 8
  • 16
  • You can use git by itself if you just want to pull down a single project - the challenge is that it won't be well integrated with repo for an overall build. But it could be interesting as a debugging step to try it and see if that also fails. Beware that frameworks/base is one of the larger pieces of Android so it will take a while. – Chris Stratton May 11 '15 at 12:50

3 Answers3

2

You should not use git clone to checkout Android source code.

Use repo all the way:

curl https://storage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
repo init -u --config-name https://android.googlesource.com/platform/manifest -b android-5.1.1_r1
repo sync

If that does not work, clean up your repo files:

rm -rf ~/.repo/
shkschneider
  • 17,833
  • 13
  • 59
  • 112
  • How can I fix the error then ? Not a git repository – Ashish Krishnan May 06 '15 at 08:19
  • You still get that error after the `repo init` and `repo sync`? Then I would suggest you just clean (remove) your repo files in *~/.repo*. – shkschneider May 06 '15 at 08:22
  • Yes. I still get the error. can I do "repo" for specific folders.? I guess I the folder frameworks/base.git is having errors. I do remember getting a error "FATAL: Unexpected EOF" at remote repository. Should I report to google? Is it anything worth? – Ashish Krishnan May 06 '15 at 08:27
  • 1
    You can always report to Google to help improve `repo`'s ability to recover from an error. For now you could repose *frameworks/base* entirely and let `repo` sync it back again, starting fresh with a valid repository (but also do this in *~/.repo*, that is what `repo` complains about). – shkschneider May 06 '15 at 08:28
  • Repose framworks/base? ... Any other temporary fix to the current problem.? Should I use some other build than LMY4V android android-5.1.1_r1? > fatal: The remote end hung up unexpectedly > fatal: early EOF and I am reporting to google – Ashish Krishnan May 06 '15 at 08:35
  • "Any temporary fix" have you tried what I suggested? `rm -rf ~/.repo/projects/frameworks/base` and `rm -rf frameworks/base`? – shkschneider May 06 '15 at 08:36
  • Yes. No change! I am going for a fresh repo. – Ashish Krishnan May 06 '15 at 08:50
2

Only solution I found to fix the above problem is to start FRESH.

As per the above post

rm -rf ~/.repo/ 

didnt quite remove the files for me. Please try that too. Thanks to @shkschneider for giving that answer. So bascially you have to remove bin folder and the .repo folder manually before you start fresh.

Tips for starting fresh:

USE repo sync -j1 for sync the Android Source Tree. It takes time but it is the best solution to problems like remote hung up unexpectedly. I may be wrong in this. but none of the methods found on the internet helped me.

Ashish Krishnan
  • 422
  • 2
  • 8
  • 16
1

Find all necessary .git files in .repo directory and delete them. For me, it was working ok

Petrov Dmitrii
  • 228
  • 1
  • 10