LoginSignup
6
2

More than 3 years have passed since last update.

【Mac】Android studioのAVD Managerからエミュレーターを起動すると「unable locate to abd」となる

Last updated at Posted at 2020-11-24

環境

macOS Catalina 10.15.7
Android studio 4.1.1

発生している事

AVD ManagerからエミュレーターからPixel 2 API 28 を起動すると下記のような警告が出る。
image.png

エミュレーター自体はその後起動するのだが、Debugしてもアプリが動かない。

試した事

/Users/ユーザ名/Library/Android/sdk/platform-tools 配下にあるadbへのパスを通した後、以下コマンドを叩いてみたところデバイスは表示されるようになる。
※ない場合はDownloadして設置
SDK Platform-Tools リリースノート

$ adb devices

Android Studioを再起動して再チャレンジしたが、解消されず。

よく見るとDebugした時のConsoleに以下のエラーが出ている。
当初のエラーとは因果関係はないかもしれないが、デバッグできない理由はこっちかもしれないのでこちらも合わせて要調査

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3
     platforms;android-29 Android SDK Platform 29
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: /Users/onsiter/Library/Android/sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
Exception: Gradle task assembleDebug failed with exit code 1
  • Flutterのエラーで良くつまずく所で、以下を実行して確認するとよいらしい。 flutter doctor

以下のように表示があった。

略
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
略

表示されてる通り、以下を実行。
flutter doctor --android-licenses

所々YesとNoを求められるので、全部「Y」で次へ進める。

「unable locate to abd」のエラーは解決しませんでしたが、デバッグはできるようになりました。

結果

まだ未解決
解決次第アップします。

参考URL

AndroidStudid での “Unable to locate adb” の対処法
ターミナルにadbのパスを通す(Mac)

6
2
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
2