LoginSignup
12
4

More than 5 years have passed since last update.

React Nativeでrun-androidしたときにNo connected devices!になる

Posted at

はじめに

React NativeではCLIからシミュレータを起動してアプリの動作確認ができます。
iso,androidそれぞれに対応しているのですが、android側で下記のエラーが発生しました。
解決は簡単だったのですが一応備忘として記載。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

エラー解決

結論から言うとシミュレータを起動した状態でreact-native run-androidを実行すればエラーなくシミュレータにアプリがインストールされます。

run-iosの方はコマンドを実行すると勝手にシミュレータを立ち上げてくれるのですが、androidの方は事前にシミュレータを立ち上げておかないといけないようです。

React NativeのGithubのissueにも同様の質問が上がっており、対応策も同じでした。

Failed run android simulator : No connected devices!

androidシミュレータの起動方法

こちらのサイトが画像付きで分かりやすかったので参考にさせていただきました。
[Android] エミュレータ AVD Manager の設定

12
4
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
12
4