6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Android]gradlew実行でbash\r: No such file or directory

Posted at

Androidアプリのapk作成時に、gradlew実行で以下のエラーが発生した。

Mac OS X のターミナルで実行

>./gradlew clean build
 /usr/bin/env: bash\r: No such file or directory

原因:gradlewファイルの改行コードがunix format でないため。windows環境でソースをgit clone するとそうなる。
対処法:gradlewファイルをvimで開き、コマンドモードで以下コマンドを実行して保存する。その後、再びgradlew実行する。

set fileformat=unix

ファイルを開くところから書くとこう

>vim gradlew
:set fileformat=unix
:wq
>./gradlew clean build

buildが完了するまで待ってOK

参考リンク
stackoverflow

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?