下载Android源代码错误汇总分析

来源:互联网 发布:淘宝数据的uv是什么 编辑:程序博客网 时间:2024/06/14 08:14

原文链接:http://blog.csdn.net/mc_hust/article/details/33304733


我自己出现了第五个问题,这个解决办法看似比较靠谱:


5.另外还有一个很少出现的错误。同样是在repo sync时,如果出现如下错误:

[html] view plaincopyprint?
  1. remote: Sending approximately 1.11 GiB ...  
  2. remote: Counting objects: 42, done  
  3. remote: Finding sources: 100% (42/42)  
  4. remote: Sending approximately 200.67 MiB ...  
  5. remote: Counting objects: 18, done  
  6. remote: Finding sources: 100% (18/18)  
  7. error: RPC failed; result=56, HTTP code = 2000 KiB/s       
  8. fatal: The remote end hung up unexpectedly  
  9. fatal: 过早的文件结束符(EOF)  
  10. fatal: index-pack failed  
  11. error: RPC failed; result=56, HTTP code = 200  
  12. fatal: The remote end hung up unexpectedly  
  13. fatal: early EOF  
  14. fatal: unpack-objects failed  
  15. error: RPC failed; result=56, HTTP code = 200  
  16. fatal: The remote end hung up unexpectedly  
  17. fatal: 过早的文件结束符(EOF)  
  18. fatal: index-pack failed  
  19. error: RPC failed; result=56, HTTP code = 200  
  20. fatal: The remote end hung up unexpectedly  
  21. fatal: 过早的文件结束符(EOF)  
  22. fatal: index-pack failed  
这个问题挺尴尬的,这是由于网络信号不顺畅造成的,比较Android官方网站设在国外,国内的网络常常会故障。大家可以留意一下在崩溃之前终端显示的下载速度,是不是由M编程KB ,然后慢慢变小,最后直接崩溃。。。

解决方法:

网络不顺通常是一时的,这里的办法除了换网之外只有反复执行 repo sync。当然这里完全不需要自己去反复执行,可以通过编写一个脚本程序,让计算机在下载崩溃后自动重新下载。在代码目录建立一个脚本(sh)文件,输入如下

[plain] view plaincopyprint?
  1. #!/bin/bash  
  2.   
  3.  echo ¨================start repo sync===============¨  
  4.   
  5.  repo sync -f -j10  
  6.   
  7.  while [ $? == 1 ]; do  
  8.  echo ¨================sync failed, re-sync again=============¨  
  9.  sleep 3  
  10.  repo sync -f -j10  
  11.  done  

之后可以做自己的事,让程序自动下载,当你蓦然回首的时候,它已经默默下载成功了。。

谢谢~~

0 0