- How to Fix “Failed to install the following Android SDK packages as some licenses have not been accepted” Error in Android Studio?
- What are Android SDK packages?
- How To Solve Failed to install the following Android SDK packages?
- Method 1
- Method 2
- Method 3
- Method 4
- Method 5
- You have not accepted the license agreements of the following SDK components: [Google Repository]. #1726
- Comments
- muzammilahmed commented Nov 26, 2016 •
- Как принять лицензии Android Studio SDK?
- 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. #11
- Comments
- viktorbenei commented Nov 23, 2016
- Bitrise Build Issue Report template
- Description of the issue
- Environment:
- Reproducibility
- Linux/Android stack builds
- Build log
- viktorbenei commented Nov 23, 2016
- Автоматически принимать все лицензии SDK
- 30 ответов:
How to Fix “Failed to install the following Android SDK packages as some licenses have not been accepted” Error in Android Studio?
When you download the latest Android SDK tools version using the command line to install SDKs and you just try to build gradle then this error shows up:
You may face this error even after typing y as the answer for the question: Do you accept the license ‘android-sdk-license-c81a61d9’ [y/n]: y. So we need to look at why this error is popping up? Because of this error, we cannot compile our project. So In this article, we will talk about how to solve this error using five different methods. But before directly jumping to solutions first let’s see something about Android SDK.
What are Android SDK packages?
SDK stands for software development kit or devkit for short. The Android SDK consists of an emulator, development tools, sample projects with source code, and the required libraries to build Android applications. The Android SDK Manager, manages various Android SDK versions, tools, and various other useful packages that you can select and download, to keep your development environment up-to-date.
How To Solve Failed to install the following Android SDK packages?
Method 1
You need to accept the licenses before building. According to Android SDK docs, you can use the following command depending on the SDK manager location: Docs on –licenses option seems to be missing though. yes | sdkmanager –licenses
Windows:
Step 1: Navigate to %ANDROID_HOME%/tools/bin .
%ANDROID_HOME% is the path to SDK. By default it is located at : C:\Users\UserName\AppData\Local\android\Sdk . If you have moved SDK to another directory location then you can follow below steps :
- Search for edit the system environment variables.
- Then in the environment variables, you will see ANDROID_HOME.
- Navigate to that path in cmd
Step 2:
After successfully navigating just type below command and you are done.
GNU/Linux Distributions:
macOS:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
Flutter Users:
Just type flutter doctor –android-licenses in the terminal and wait for few seconds. You will see “All SDK package licenses accepted” on your screen.
Method 2
Step 1: In Android Studio go to Tools > SDK Manager.
Step 2: Go to the SDK Tools tab as shown in the below image.
Step 3: Select the Android SDK Command-line Tools (latest) and download by pressing Apply.
Method 3
in Windows OS go to your sdkmanager path then execute
You can find your sdkmanager at: \Android\tools\bin
IF you don’t know where is your SDK located, then follow these steps:
- Open Android Studio
- Navigate to Your Project > Files > Setting > Appearance and Behavior > Android SDK
Method 4
Step 1:Go to your $ANDROID_HOME/tools/bin and fire the cmd and type the below command:
Accept All licenses listed there.
Step 2:
After this just go to the licenses folder in SDK.
Check that it’s having these five files:
- android-sdk-license
- android-googletv-license
- android-sdk-preview-license
- google-gdk-license
- mips-android-sysimage-license
Step 3:
Give a retry and build again, still, Jenkins giving ‘licenses not accepted” then you have to give full permission to your ‘SDK’ directory and all its parent directories. Here is the command:
If you having sdk in /opt/ directory.
Method 5
For Windows users:
Step 1: Go to the location of your sdkmanager.bat file. By default, it is at Android\sdk\tools\bin inside the %LOCALAPPDATA% folder.
Step 2: Open a terminal window there by typing cmd into the title bar. Then go to the above path(Android\sdk\tools\bin as highlighted by the white line in the below image) and type :
Источник
You have not accepted the license agreements of the following SDK components: [Google Repository]. #1726
Comments
muzammilahmed commented Nov 26, 2016 •
I’m using cordova push plugin plugin for push notifications I’ve installed google repository and google play services packages from android SDK manager., but when ever I execute ionic build android to create build its gives me following error.
FAILURE: Build failed with an exception.
Total time: 13.856 secs
- What went wrong:
A problem occurred configuring root project ‘android’.
You have not accepted the license agreements of the following SDK components:
[Google Repository].
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
- Try:
Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project ‘android’.
You have not accepted the license agreements of the following SDK components:
[Google Repository].
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
- Try:
Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output.
The text was updated successfully, but these errors were encountered:
Источник
Как принять лицензии Android Studio SDK?
Итак, перейдя непосредственно к проблеме, я установил последнюю версию Android Studio (3.6.3). Но всякий раз, когда я пытаюсь построить проект и запустить его на эмуляторе, он выдает сообщение об ошибке «Я не принял лицензии SDK» . Это не единственная ошибка, которая появляется. Я приложил скриншот, который вы можете увидеть, чтобы иметь представление о том, что на самом деле является ошибкой (Ошибка Gradle ) .
Я попытался использовать метод cmd, который принимает все лицензии, но он не работает, и cmd выдает ошибку «Системе не удается найти указанный путь» (Ошибка Cmd). Возможно, что я получаю неправильный доступ, я полностью неграмотный. После проверки в папке SDK нет \ tools \ bin (мой путь к SDK). Также я попытался переустановить.
Пожалуйста, помогите мне. Вся моя работа застряла из-за этой ошибки. Любая помощь приветствуется.
2 ответа
В консоли ошибок обычно есть ссылка на отсутствующие инструменты.
Если нет, зайдите в меню Сервис / SDK
- Затем на вкладку SDK Tools
- Проверьте инструменты сборки SDK
И тогда вам будет предложено принять лицензии. Будьте осторожны, потому что это радио-кнопка и она немного скрыта.
Если это не удается после выполнения этого наблюдения в консоли, если есть ссылка для установки недостающих инструментов.
Вопрос решен. Как я это решил?
Это было довольно легко, хотя я только что установил еще три (3) SDK-платформы для i-e Android 9.0, Android 8.1 и Android 8.0. инструменты \ sdkmanager \ sdk-platform в IDE Android Studio
Я не знаю, почему это исправило это, но это сделало.
Источник
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. #11
Comments
viktorbenei commented Nov 23, 2016
Bitrise Build Issue Report template
Description of the issue
Error: 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.
Environment:
Where did the issue happen?
- If on Bitrise.io: which stack? YES
Which build Step causes the issue and which version of the step?
Reproducibility
- Does a «Rebuild» help? (You can trigger a rebuild from the Build’s page, by clicking the «Rebuild» button in the top right corner of a finished build) — NO
- Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. — NO
- Does upgrading the build Step to the latest version help? — NO
Linux/Android stack builds
- Can it be reproduced by running the build locally, after doing a clean git clone (git clone the repository, into a new directory, somewhere on your Mac/PC) and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: http://blog.bitrise.io/2016/08/08/debug-your-android-linux-builds-locally-with-docker.html
Build log
The text was updated successfully, but these errors were encountered:
viktorbenei commented Nov 23, 2016
If a package is auto installed by Gradle in the system, you still have to accept the licenses.
In a CI system the easiest automated way is to copy the license files from your Mac/PC into the CI system’s android licenses directory.
Locate the licenses on your Mac/PC:
If you have accepted the license agreements on one workstation, but wish to build your projects on a different one, you can export your licenses by copying the accepted licenses folder from the Android Sdk Home folder (this should be located at /licenses) of your current workstation, to the Android Sdk Home directory of the machine where you now want to build your projects.
Create an android-licenses directory in the root directory of your git repository, and copy the license files into this directory, then in your Workflow copy the licenses to the right location using a Script step.
Add the Script step right after the Git Clone step (that’s when your code is available on the build virtual machine), with the content:
That’s all, this script copies the licenses from the android-licenses (from your repository) into the system’s Android SDK Home path under licenses directory.
Источник
Автоматически принимать все лицензии SDK
Так как gradle Android Плагины 2.2-alpha4:
Gradle попытается загрузить отсутствующие пакеты SDK, которые проект зависит от
что удивительно круто и было известно, чтобы быть JakeWharton project.
но, чтобы загрузить библиотеку SDK вам нужно: принять лицензионные соглашения или gradle говорит вам:
вы не приняли лицензионные соглашения следующего пакета SDK компоненты: [Android SDK Build-Tools 24, Android SDK Platform 24]. Прежде чем строить свой проект, вам необходимо принять лицензию соглашения и завершить установку недостающих компонентов использование диспетчера SDK для Android Studio. Кроме того, чтобы узнать, как перенесите лицензионные соглашения с одной рабочей станции на другую, перейдите по ссылке http://d.android.com/r/studio-ui/export-licenses.html
и это проблема, потому что я хотел бы установить все зависимости sdk при выполнении gradle build .
Я ищу решение для автоматического принятия всех лицензий. Может быть, сценарий gradle ? У тебя есть какие-нибудь идеи ?
решение должно было выполнить:
и установите его вручную, но это новая функция gradle, чтобы сделать это.
лучшим решением является использование sdkmananger:
30 ответов:
я столкнулся с этим с alpha5 предварительный просмотр.
Джейк Уортон указал мне, что в настоящее время вы можете использовать
чтобы воссоздать текущий $ANDROID_HOME/license папка на вашей машине. Это будет иметь тот же результат, что и процесс, описанный в ссылке ошибки msg (http://tools.android.com/tech-docs/new-build-system/license).
хэши-это sha1s текста лицензии, который, я полагаю, будет периодически обновляться, поэтому этот код будет работать только так долго 🙂
и установите его вручную, но это новая функция gradle, чтобы сделать это.
сначала я был удивлен, что это не сработало из коробки, даже когда я принял лицензии на именованные компоненты через android инструмент, но мне было указано его менеджер SDK внутри, как это создает .
Я думаю, что официальные инструменты не хотел бы пропустить этот шаг юридические соображения.
перечитывая заметки о выпуске, он заявляет
автоматическая загрузка SDK: Gradle попытается загрузить отсутствующие пакеты SDK, от которых зависит проект.
что не означает, что это будет работать, если вы еще не установили Android tools и уже приняли последнюю лицензию(ы).
EDIT: говоря это, он все еще не работает на моем тестовом поле gubuntu, пока я не свяжу SDK с AS. CI работает нормально, хотя-нет знаете, в чем разница.
Источник