「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfrastructure.osscons.jp]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。

-[[戻る>Androidのデバッグ]]

*目次 [#mff6221e]
#contents

*概要 [#qc98ff67]
良くハマるので。

*A problem occurred configuring project ':CordovaLib'. [#w1f13127]
**You have not accepted the license agreements of the following SDK components: [#w5f8b746]

***エラー・メッセージ [#lad4dced]
 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

***解決 [#wb889961]
-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

***参考 [#j3882ed1]
-CI環境でandroid-sdkのライセンスに同意する - Qiita~
https://qiita.com/akym03/items/7646732b220412b085b7

**Failed to install the following SDK components: [#r9034ce7]

***エラー・メッセージ [#n85022ae]
 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.

***解決 [#r021f150]
下記の参考情報に、

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

とある。

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

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

***参考 [#b9effd3e]
-[SOLVED] Ionic package build android - ionic - Ionic~
https://forum.ionicframework.com/t/solved-ionic-package-build-android/107042
-[0.0.39] "ionic platform add android" fails · Issue #302 · ionic-team/ionic-app-scripts~
https://github.com/ionic-team/ionic-app-scripts/issues/302

*App successfully launched. Attaching to android. [#e4f7aea1]

**Unable to find adb. Please ensure it is in your PATH and re-open Visual Studio Code [#h08436e9]

***エラー・メッセージ [#lbb2a796]
 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

***解決 [#z18995a7]
-PATH環境変数の再設定(Android Studio再インストールでSDKのパスが変わっていた)。
-[[PATH環境変数の再設定>https://techinfoofmicrosofttech.osscons.jp/index.php?Cordova%20Tools%20Extension#h88368b2]](Android Studio再インストールでSDKのパスが変わっていた)。
-C:\Program Files (x86) ---> C:\Users\xxxx\AppData\Local\Android\sdk

***参考 [#sd6240f2]
-Unable to attach debugger to Android emulator · Issue #126 · Microsoft/vscode-cordova~
https://github.com/Microsoft/vscode-cordova/issues/126

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS