Skip to content

DNET_AndroidDebuggingTroubleshoot

nishi_74322014 edited this page Sep 11, 2026 · 1 revision

Androidのデバッグ - トラブルシュート

概要

良くハマるので。

A problem occurred configuring project ':CordovaLib'.

You have not accepted the license agreements of the following SDK components:

エラー・メッセージ(ライセンス未承諾)

FAILURE: Build failed with an exception.

Warning: License for package Android SDK Build-Tools 26.0.2 not accepted.
Checking the license for package Android SDK Platform 26 in C:\Program Files (x86)\Android\android-sdk\licenses
Warning: License for package Android SDK Platform 26 not accepted.
* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

解決(ライセンス未承諾)

  • CMDを管理者実行

  • cd

    cd C:\Program Files (x86)\Android\android-sdk\tools\bin
    
  • sdkmanager --list

    sdkmanager --list
      Available Packages:
        Path                              | Version      | Description
        -------                           | -------      | -------
        ・・・
        platforms;android-26              | 2       | Android SDK Platform 26           | platforms\android-26\
        ・・・
    
  • sdkmanager "path"

    sdkmanager "platforms;android-26"
      Accept? (y/N): y
      done
    

参考(ライセンス未承諾)

Failed to install the following SDK components:

エラー・メッセージ(SDKインストール失敗)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Failed to install the following SDK components:
  [Android SDK Build-Tools 26.0.2]
  The SDK directory (C:\Program Files (x86)\Android\android-sdk) is not writeable,
  please update the directory permissions.

解決(SDKインストール失敗)

下記の参考情報に、

「config.xmlとpackage.jsonにversion / specの^または〜が含まれていないことを確認」

とある。

config.xmlとpackage.jsonを修正してみるがダメ。

「please update the directory permissions.」とあったので、愚直に環境再構築で復旧
(Android StudioとSDKをアンインストールしてfolder全削除後に再インストール)。

参考(SDKインストール失敗)

App successfully launched. Attaching to android.

Unable to find adb. Please ensure it is in your PATH and re-open Visual Studio Code

エラー・メッセージ(adb が見つからない)

Launching for android (This may take a while)...
App successfully launched
Attaching to android
Unable to find adb. Please ensure it is in your PATH and re-open Visual Studio Code

解決(adb が見つからない)

  • PATH環境変数の再設定Cordova Tools Extension の該当節)
    (Android Studio再インストールでSDKのパスが変わっていた)。
  • C:\Program Files (x86) ---> C:\Users\xxxx\AppData\Local\Android\sdk

参考(adb が見つからない)

移行メモ

  • 元 Wiki には「エラー・メッセージ」「解決」「参考」という見出しがそれぞれ 複数あり GitHub Wiki でアンカが衝突するため、括弧で文脈を補って一意にした。
  • 元 Wiki の行頭空白によるエラー・メッセージやコマンドは、 フェンス付きコードブロックにした。
  • マイクロソフト系技術情報 Wiki への URL リンクは、 移行済みの Cordova Tools Extension に張り替えた。
  • 本ページは 2018 年時点の Cordova / Android SDK に関する情報である。

Tags: 移行, Android, デバッグ, トラブルシュート, Cordova, Android SDK, Visual Studio Code, adb

NetDevInfraWiki

マイクロソフト系技術情報 Wiki
Open 棟梁 Wiki

(未着手)

開発基盤部会 Wiki

移行管理: DONETODO

Clone this wiki locally