1

Before I start, I have tried all the other answers but nothing seems to work. For example: env: python\r: No such file or directory.

I am building android source code on OS X El Capitan and I get this error when i run the command "make clobber".

env: python\r: No such file or directory
/bin/bash: out/soong/soong: No such file or directory
make: *** [run_soong] Error 127

soong is a symbolic link. I have executed the command dos2unix on the target file. enter image description here

what am i missing ? Thanks in advance!

Community
  • 1
  • 1
alazar
  • 173
  • 7
  • 1
    Looks like a python script has a shebang line (the `#! ...` line) terminated by a carriage return `\r` that is interpreted as part of the `python\r` name. It could be related to your second error. I suspect that the erroneous python script is supposed to generate `soong.bash`. Note: instead of using screen shots, please copy-paste the error messages and format them properly. – Renaud Pacalet Aug 10 '16 at 07:18
  • A `\r` at the end of a line means that the file was created with a DOS/Windows editor. Run a utility like `dos2unix` over the file. – John1024 Aug 10 '16 at 07:20
  • @john1024 I did do that on song.bash. That is the file you are talking about right ? – alazar Aug 10 '16 at 07:24
  • From the screen capture, the name of the file that contains `python\r` is not clear to me. But, if you edited any of the files on Windows, running `dos2unix` over them is a good idea. (Some editors on Windows are good at respecting Unix line endings. Others are not.) – John1024 Aug 10 '16 at 07:37
  • I downloaded everything directly to my laptop. I did not edit any of the files on windows. I followed google's instruction and was successful until i got to this part. I even uninstalled everything and did everything from scratch carefully but still ended up at the same error. https://source.android.com/source/building.html Thank you for all your help. – alazar Aug 10 '16 at 08:08
  • @TheA8nova The error message indicates that `env` was looking for a program named `python\r` and, of course, there is no such program. The `\r` might have been mistakenly left in a file uploaded to the website. It is also possible that, in the process of downloading the file, `\r` characters were added. Whatever the cause, the `\r` do not belong there and `unix2dos` is the solution. – John1024 Aug 10 '16 at 08:13

1 Answers1

0

I fixed my error by dos2unix-ing from the source directory. It took a little longer than 30 minutes but then it worked! something likes this from the source tree :

find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix

alazar
  • 173
  • 7