Jitpack: Failed to install the following Android SDK packages as some licences have not been accepted

只谈情不闲聊 提交于 2019-12-12 10:43:27

问题


I've googled, and some says it's fixed after few trys, and by creating a new release, but It doesn't seem to work for me.

How can I resolve this?

* What went wrong:
A problem occurred configuring project ':analytics'.
> Failed to notify project evaluation listener.
   > Failed to install the following Android SDK packages as some licences have not been accepted.
        platforms;android-27 Android SDK Platform 27
        build-tools;27.0.3 Android SDK Build-Tools 27.0.3
     To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
     Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

     Using Android SDK: /opt/android-sdk-linux
   > Cannot add task ':analytics:install' as a task with that name already exists.
   > Could not get unknown property 'androidJavadocs' for project ':analytics' of type org.gradle.api.Project.

https://jitpack.io/com/github/littlehome-eugene/analytics-android/1.0/build.log


回答1:


You have probably ran into: https://issuetracker.google.com/issues/123054726

As a workaround I installed it individually. i.e.

$ yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27"
$ yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3"



回答2:


I had the same problem, uhh spend a few hours until finally found a solution

In short:

1) Create a private gist android-sdk-license.sh with this content:

#!/bin/bash

set -ex

cd $ANDROID_HOME
mkdir -p licenses

cat << EOF >> licenses/android-sdk-license
8933bad161af4178b1185d1a37fbf41ea5269c55
d56f5187479451eabf01fb78af6dfcb131a6481e
24333f8a63b6825ea9c5514f83c2829b004d1fee
EOF

2) Get a raw link to this file
3) Create jitpack.yml in the root of your project with this content:

#!/bin/bash

before_install:
- curl PASTE_RAW_LINK_TO_GIST | sh

4) Commit & push

Hope this helps




回答3:


Are you sure that you have the correct SDK Platform installed?

If not, go to Android Studio, then Android Studio > Preferences > Appearance & Behaviour > System Settings > Android SDK. Select Android 8.1 with API Level 27 and install it.

Hope this helps.




回答4:


That fixed our CI build, adding yes | before installing system image, platform and build tools.

RUN yes | sdkmanager --licenses

# update
RUN yes | sdkmanager --update

# Update SDK manager and install system image, platform and build tools
RUN yes | sdkmanager \
  "tools" \
  "platform-tools" \
  "extras;android;m2repository" \
  "extras;google;m2repository" \
  "extras;google;google_play_services" \
  "patcher;v4" \
  "build-tools;$ANDROID_TOOLS_VERSION" \
  "platforms;android-$ANDROID_BUILD_VERSION"

RUN sdkmanager --version



回答5:


To get rid of this error, close android studio and then run android studio again but this time, run as administrator



来源:https://stackoverflow.com/questions/54268074/jitpack-failed-to-install-the-following-android-sdk-packages-as-some-licences-h

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!