Programing

라이센스 계약에 동의 할 수 없음 Android SDK Platform 24

crosscheck 2020. 7. 26. 12:25
반응형

라이센스 계약에 동의 할 수 없음 Android SDK Platform 24


Cordova 프로젝트에 Android 플랫폼을 설치하려고 할 때 다음 오류가 발생합니다. 나는이 안내서를 따르고 있습니다 : https://cordova.apache.org/docs/en/latest/guide/cli/

다음을 실행할 때 오류가 발생합니다 : $ cordova platform add android --save

루트 프로젝트 'android'를 구성하는 중에 문제가 발생했습니다. 다음 SDK 구성 요소의 라이센스 계약에 동의하지 않았습니다. [Android SDK Platform 24].

Android SDK Platform 24의 라이센스 계약에 동의하는 방법을 찾기 위해 모든 것을 검색 했지만 실제로는 운이 없습니다.

미리 감사드립니다.


당신은 또한 실행할 수 있습니다

$ ANDROID_HOME / tools / bin / sdkmanager-라이센스

또는 Windows 실행

% ANDROID_HOME % / tools / bin / sdkmanager-라이센스

(@ puneet-kumar에게 Windows 명령에 대한 신용)


Cordova의 작동 방식을 정확히 모르겠지만 라이센스가 승인되면 파일이 생성됩니다. 해당 파일을 수동으로 만들 수 있습니다. 이 질문 에 설명되어 있지만 필요한 라이센스 파일을 작성하는 명령 은 다음과 같습니다 .

리눅스 :

mkdir "$ANDROID_HOME/licenses"
echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"

윈도우 :

mkdir "%ANDROID_HOME%\licenses"
echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"

Cordova 6.4.0 및 Android Studio 2.2.3이 설치된 Mac OS X 10.12.1에서이 문제가 발생했습니다.

Android Studio를 설치하면 플랫폼 25가 설치되었지만 24는 설치되지 않았습니다. 24를 설치하려면 다음을 수행하십시오.

  • Android Studio를 엽니 다.
  • 를 엽니 다 Android Studio Menu > Preferences.
  • Appearance & Behavior > System Settings > Android SDK
  • 상자를 체크 Android 7.0 (Nougat) | 24
  • 확인을 클릭하고 지시 사항을 따르십시오.

나는 정확히 같은 문제가 있었다. 그런 다음 "Android 7.0 (API 24)> SDK 플랫폼"을 설치하고 작동했습니다.

여기에 이미지 설명을 입력하십시오


Android \ sdk \ tools \ bin으로 이동

늦었지만 위에서 언급 한 모든 솔루션이 나에게 효과가 없었으며 마침내이 단일 라인은 모든 안드로이드 라이센스를 허용합니다.

yes | sdkmanager --licenses && sdkmanager --update

이 문제를 해결하는 가장 간단한 방법은 다음 명령을 사용하여 라이센스를 수락하는 것입니다.

Windows OS :

C:\Users\{your-username}\AppData\Local\Android\sdk\tools\bin\sdkmanager --licenses

면책 조항이 제공됩니다. 개발 노력을 계속하려면 모든 면책 조항에 'y'로 대답해야합니다.


문제가 발생했습니다. 폴더를 복사하거나 만들 필요가 없으며 SDK 경로에주의하십시오. 환경 변수 (ANDROID_HOME)와 같아야합니다. 왜냐하면 나에게는 같지 않았습니다.

SDK 위치


제 경우에는 안드로이드 스튜디오를 사용하지 않습니다 (이클립스를 사용하고 있습니다). 나는 다음 단계를 수행했다 : 단지 명령을 실행하여 해결

android-sdks/tools/bin$ ./sdkmanager --update

licenses디렉토리를 만들고 그 android-sdk-license안에 파일을 추가 했습니다.

그런 다음 실행할 수 있습니다 ( licenses위의 단계를 수행하지 않으면 옵션을 사용할 수 없습니다)

android-sdks/tools/bin$ ./sdkmanager --licenses

라이센스에 동의합니다 (그러나 필자의 경우에는 그렇게 할 필요가 없었습니다)


SDK 관리자를 통해 android sdk build-tools 24 (현재 버전 24.0.3)를 설치했습니다. SDK 관리자를 여는 경로는 첨부 된 img 파일에 표시됩니다. 이것은 내 문제 SDK 관리자를 해결


Android Studio를 설치하여 Android SDK를 사용 했으며이 오류도 발생했습니다. 사용자 안내서 의 간단한 해결책이 있습니다 .

  1. Android Studio가 설치된 컴퓨터에서을 클릭하십시오 Tools > Android > SDK Manager. 창 상단에서 Android SDK 위치를 확인하십시오 .

  2. 해당 디렉토리로 이동하여 해당 디렉토리를 찾으 licenses/십시오.

    ( licenses/디렉토리 가 표시되지 않으면 Android Studio로 돌아가서 SDK 도구를 업데이트 하여 라이센스 계약에 동의하십시오. Android SDK 홈 디렉토리로 돌아 가면 디렉토리가 표시됩니다.)

  3. 전체 licenses/디렉토리를 복사 Android SDK home directory하여 프로젝트를 빌드하려는 머신에 붙여 넣으십시오 .


시스템이 올바른 경로에서 ANDROID_HOME 환경 변수를 선택하지 않으면이 오류가 발생할 수 있습니다. Android SDK를 설치하고 아래 이미지와 같이 ANDROID_HOME 변수를 적절한 경로로 올바르게 설정했는지 확인하십시오.

ANDROID_HOME_PATH

ANDROID_HOME 변수가 정의되지 않은 경우 시스템은 기본 경로에서 경로를 선택하려고 시도합니다 (Android SDK가 정의 된 경로가 아닐 수 있음).


이 글을 쓰는 시점에서 기본적으로 Ionic CLI 도구는 기본적으로

<preference name="android-targetSdkVersion" value="LATEST_SDK_VERSION"/> 

이것이 라이센스 계약에 동의하지 않는다고 불만을 제기하는 이유이지만 실제로 는 해당 API 레벨에 대한 SDK 패키지설치하지 않고 라이센스 만 수락합니다.

그래서 당신이해야 할 일은

  1. 대상 SDK 버전 변경
  2. SDK 관리자 에서 최신 SDK API 레벨 설치

SDK 버전 변경

수동으로 수행하고 실행하여 확인할 수도 있습니다.

ionic cordova platform add android 

파일 your-awesome-app/config.xml은 위와 같이 숨겨져 있기 때문에 파일을 열면이 줄을 추가 할 수 있습니다.

<preference name="android-targetSdkVersion" value="24"/>

어떤 API LEVEL Number 를 타겟팅 하는지 확실하지 않은 경우 개방형 SDK Manager를 사용 하고 컴퓨터에서 사용 가능한 API 레벨 (번호)을 확인하십시오.

최신 SDK 패키지 설치

당신은 현재 추가 할 수 있습니다 SDK 패키지 CLI가 귀하의 경우에이 표시되고, (24)

관리자 권한 SDK MANAGER으로 실행

SDK 관리자를 관리자 권한으로 실행

설치 SDK의 API 패키지 는 대상으로하는

SDK API 레벨이 작성된 곳

어떻게 알았습니까? 나는 오늘 아침에 그것을했고 그것이 내가 그것을 해결 한 방법이며 지금 은 약간 긴장을 풀기 위해 Android 에서 Sticky Bubble을 하고 있습니다.

행복한 배포!


In my case (Dockerfile script to build an Android CI container - https://github.com/menny/docker_android), I had to do these steps:

mkdir ~/.android && touch ~/.android/repositories.cfg
yes | sdkmanager --licenses
sdkmanager "build-tools;26.0.0"
sdkmanager "platform-tools" "tools"
sdkmanager "platforms;android-26" "platforms;android-25" "platforms;android-24"
.....
sdkmanager --update
yes | sdkmanager --licenses

Two notes:

  1. Had to create an empty repositories.cfg file or sdkmanager would die.
  2. Had to perform the fetching/installing of packages in different calls, since there is no progress indication.

Go to C:\Users{user}\AppData\Local\Android\sdk\tools\bin

then run sdkmanager --licenses

it'll ask you to accept whatever the agreements remaining to be accepted. you'll just have to type "y" and enter.

Will solve the issue


Install the following component:

여기에 이미지 설명을 입력하십시오


I am using Mac and I resolved it using this command:

$ which sdkmanager
/usr/local/bin/sdkmanager
$ /usr/local/bin/sdkmanager --licenses
Warning: File /Users/user/.android/repositories.cfg could not be loaded.
6 of 6 SDK package licenses not accepted.
Review licenses that have not been accepted (y/N)? y

Then I had a list of 6 licenses to accept and its resolved after that.


You can also follow the "official" way. Run "sdkmanager --licenses" within tools/bin folder of Android SDK installation and accept all licenses. Done!

c:\android-sdk\tools\bin>sdkmanager --licenses

For macOS or Linux it's the same command.


I had to update the android sdk

android update sdk --no-ui

at some point it will ask you for license agreement, press y. After that you need to remove the angular platform.


  1. Go to Android SDK location

C:\Users\username\AppData\Local\Android\sdk\tools\bin

  1. Run command sdkmanager --licenses

  2. Accept the licence for SDK


It needs a latest stable sdk-platform installed. I installed SDK-Platform from API 25. It fixed my problem.아래 스크린 샷을 참조하십시오


This issue is surfacing when already an old version of SDK Manager is in the machine from where the approach of Android build is Changed which requires "android studio". I faced this in Visual Studio that was repeatedly halted with Error Message, "You have not accepted the License for version 25". The solution for this is "Install the Android Studio" and then "go to Environment Variables" and set the ANDROID_HOME to "C:\Users\\AppData\Local\Android\Sdk" (This path can be picked from Android Studio, Menu >> Tools >> SDK Manager. Also use the same in "path" of Environment Variables. This way, the new SDK manager is mapped for pickup by Visual Studio Build for Cordova Application.

This just took my 2 days effort second time

Wish others don't waste their time in this mess.


Changing the target build might work as referenced here

If you want to specify the SDK version you can do so by adding the following line to your config.xml in the root of your ionic / cordova project

<preference name="android-targetSdkVersion" value="23"/>

you need to manually re-install sdk this help me: https://forum.ionicframework.com/t/you-have-not-accepted-the-license-agreements-of-the-following-sdk-component/69570/6

"android update sdk --no-ui --filter build-tools-24.0.0,android-24,extra-android-m2repository"


Hope this will work for someone out there
I was facing the same issue! I had 2 sdks, named as sdk and sdk1. It was default linked to sdk but the working one was sdk1. So I went to Environment Varaible and added ANDROID_HOME and path of the sdk1, i.e. in my case was C:\Users\tripa_000\AppData\Local\Android\sdk1 , and it solved my problem!


For me I was Building the Ionic using "ionic build android" command and I was getting the same problem! The solution was simply

  • To install the required sdk
  • Run the same command in CMD must be as administrater

I just ran into this issue, and what solved it for me on windows, you are using command line, and you recently installed the android sdk, you must restart Command Prompt or Power Shell after you install the android sdk.


Mike's answer works.But need to put the generated license under C:\Users\user\AppData\Local\Android\sdk\licenses.


its mean miss match Android SDK version of cordova with the version you installed. For an example cordova support Android SDK 24 but you don't have Android sdk 24. it may be reverse.


This will update your android SDK and accept the license in the same time (ex for Android 25):

android update sdk --no-ui --filter build-tools-25.0.0,android-25,extra-android-m2repository


The problem for me was that my ANDROID_HOME variable was being set to another installation I forgot existed. If this is your problem, delete the old installation.

참고URL : https://stackoverflow.com/questions/40383323/cant-accept-license-agreement-android-sdk-platform-24

반응형