gradle buildヒントYou have not accepted the license agreements of the following SDK components


http://majing.io/questions/804
Android Gradle plugin 2.2.0から、gradleは必要なSDK、build-toolsを自動的にロードしますが、licenseを受け入れていないため、ロード依存が終了し、ヒント
* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Build-Tools 24.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

licenseは$ANDROIDに格納されます.HOME/licenses下
licenseの作成
異なるシステムに対応し、環境を構成した後、直接対応するbatバッチまたはshスクリプトを作成し、ダブルクリックして実行し、実行後は下図のパスの下で確認します.
指定したパスの下でフォルダファイルを正常に作成し、内容が一致しました.
Windowsスクリプト:
mkdir "%ANDROID_HOME%\licenses"
echo |set/p="8933bad161af4178b1185d1a37fbf41ea5269c55"> "%ANDROID_HOME%\licenses\android-sdk-license"
Linuxスクリプト:
mkdir "$ANDROID_HOME/licenses"echo -e "8933bad161af4178b1185d1a37fbf41ea5269c55"> "$ANDROID_HOME/licenses/android-sdk-license"
-----------------------------------------------------2017-08-17補足
Windowsユーザーの補足説明:
この2つのコマンドはAndroidのホームディレクトリの下で実行されます.すなわちandroidの環境変数構成ディレクトリです.
知らない場合はコマンドプロンプトでset ANDROIDを実行できます.ホームに見える
最後の配置結果は、コマンドに詳しくない場合は、対応するディレクトリの下に直接手動でlicenseを作成することもできます.
gradle build提示You have not accepted the license agreements of the following SDK components_第1张图片
問題があればメールを送ってください[email protected]