Skip to main content

Install missing Android SDK components Step fails with exit status 127

Updated over 9 months ago

Issue:

The Install missing Android SDK components Step throws the following error:

Failed to ensure android components, error: output: /usr/bin/env: ‘bash\r’: No such file or directory error: exit status 127

Possible solutions:

The error message suggests that your app's gradlew has Windows-style \r\n line endings instead of the \n-only line ending of Unix. You will need to replace the \r\n line endings with \n.

You have two options to fix the problem:

You can use a Script Step as a workaround. In the Script content input, add the following:

awk 'BEGIN{RS="^$";ORS="";getline;gsub("\r","");print>ARGV[1]}' ./gradlew

However, the optimal way is to make sure that Git uses a specific style of line endings in the working directory. To do so, put the following into a .gitattributes file inside your repo:

* text=auto
gradlew text eol=lf
*.sh text eol=lf
Did this answer your question?