Error: Exited sync due to fetch errors

$ repo sync
Fetching project SlimRoms/android_external_qrngd
error: Cannot fetch UBERTC/arm-eabi-5.2
Fetching project platform/external/chromium_org/third_party/libphonenumber/src/phonenumbers
Fetching projects: 86% (419/487) Fetching project SlimRoms/hardware_qcom_display
Fetching projects: 87% (424/487) Fetching project SlimRoms/hardware_qcom_display
Fetching project SlimRoms/hardware_qcom_display
Fetching projects: 89% (434/487)
error: Exited sync due to fetch errors

Sometimes, while syncing various sources, you might run into this error. If you don’t know a way to fix it or to get around it, then this can be debilitating! There are four principle ways to fix this problem, and I would like to explore those here. First and foremost, though, what is the problem? The overal problem is that while syncing the source code, there was something missing or misplaced that cannot be found by the repo tool. In this case, while syncing LiquidSmooth 5.1-Layers, the error is that the repo tool cannot find the UBERTC/arm-eabi-5.2 repository.

As I mentioned a moment ago, there are four things that you can do about this. Lets take a quick look at those options:

1. Wait and try again.
Sometimes there are little glitches or hangups that can happen due to a server being down, or your internet dropping off, or power outages, etc. Perhaps your local network went down for a while and the sync stopped, or maybe someone was moving that repository while they made some changes, or something like that. An easy thing to do is try repo sync again and see if the problem is resolved. To add validity to this option, you could go look to see if that repository does in fact exist.

2. Remove that repository from your manifest.
There are a lot of repositories on your manifest that will not have anything to do with what you are building. For instance, in this very case, I will not be using the UBERTC arm 5.2 tool chain, so I do not really care to download this repository anyways. An easy fix here is to simply remove it from my manifest, like so:

$ cd [to your folder where you were running repo sync]
$ gedit ./.repo/manifests/default.xml

You should now be presented with a file that looks like this:


<remote name=”ls”

<remote name=”cm”
fetch=”git://” />

<default revision=”refs/tags/android-5.1.1_r24″
sync-j=”4″ />

<project path=”android” name=”android” remote=”ls” revision=”lp5.1-layers” />
<project path=”build” name=”android_build” remote=”ls” revision=”lp5.1-layers” >
<copyfile src=”core/” dest=”Makefile” />
<project path=”abi/cpp” name=”platform/abi/cpp” groups=”pdk” />
<project path=”art” name=”SlimRoms/android_art” remote=”github” revision=”lp5.1″ />
<project path=”bionic” name=”SlimRoms/android_bionic” remote=”github” revision=”lp5.1″ />
<project path=”bootable/bootloader/legacy” name=”platform/bootable/bootloader/legacy” />
<project path=”bootable/recovery” name=”SlimRoms/bootable_recovery” remote=”github” revision=”lp5.1″ />
<project path=”cts” name=”platform/cts” groups=”cts,pdk-cw-fs” />
<project path=”dalvik” name=”platform/dalvik” groups=”pdk-cw-fs” />

Which, in this case I edited as so:

<!– arm toolchains –>
<project path=”prebuilts/gcc/linux-x86/arm/arm-eabi-4.8″ name=”UBERTC/arm-eabi-4.8″ remote=”bb” revision=”master” />
<project path=”prebuilts/gcc/linux-x86/arm/arm-eabi-4.9″ name=”UBERTC/arm-eabi-4.9″ remote=”bb” revision=”master” />
<!– <project path=”prebuilts/gcc/linux-x86/arm/arm-eabi-5.2″ name=”UBERTC/arm-eabi-5.2″ remote=”bb” revision=”master” /> WJH –>
<project path=”prebuilts/gcc/linux-x86/arm/arm-eabi-6.0″ name=”UBERTC/arm-eabi-6.0″ remote=”bb” revision=”master” />
<project path=”prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8″ name=”UBERTC/arm-linux-androideabi-4.8″ remote=”bb” revision=”master” />
<project path=”prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9″ name=”UBERTC/arm-linux-androideabi-4.9″ remote=”bb” revision=”master” />

As you can see, I used the “<!– –>” tokens to comment out the repository that caused the error. This will make repo skip that line of the file, and will solve my problem. However, what do you do if you need that repository? Well, that brings us to our next option.

3. Replace or repair the repository.

It could be that the repository is not actually missing, but that it is improperly typed in your manifest. Try to go to that repository on github, or where ever the “<remote” flags at the start of your file point to, and see if that repository does in fact exist. If it does exist, is there a spelling difference between it and your manifest?

If you can’t find it there, is there another place that you can find it? For instance if the “<remote” flag pointed to a bitbucket repository, is there a github repository that has the same name, and perhaps the same files you need? If so, change the project path and remote flags to match that other repository. after making the change, run repo sync again and see the results.

4. An unofficial option that works really well.

A simple, effective, yet cumbersome way to fix this problem is to mix option #2 with #3. For instance, if you need the UBERTC 5.2 tool chain for arm devices, but you can’t get option #3 to work, you could use option #2 to remove that repository from syncing. THen you can manually download the UBERTC arm 5.2 toolchain and manually place it in your files where it needs to be. This is a pretty fast way to do things, but it will cause you greif later. Particularly, you will always have to update those files manually, and you will need to know exactly where they go and what their folders should be named. But it is a good “last resort” fix.

Linux – keep it simple.


Leave a Reply

Your email address will not be published. Required fields are marked *