Jitpack:无法安装以下 Android 个 SDK 包,因为某些许可证尚未被接受

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

我用谷歌搜索了一下,有些人说尝试了几次并创建了一个新版本后就解决了,但它似乎对我不起作用。

我该如何解决这个问题?

* 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

您确定安装了正确的 SDK 平台吗?

如果没有,请转到 Android Studio,然后 Android Studio > 首选项 > 外观和行为 > 系统设置 > Android SDK。 Select Android 8.1 API 级别 27 并安装它。

希望对您有所帮助。

我遇到了同样的问题,呃花了几个小时终于找到了 solution

简而言之:

1) 使用以下内容创建私有 gist android-sdk-license.sh

#!/bin/bash

set -ex

cd $ANDROID_HOME
mkdir -p licenses

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

2) 获取此文件的原始 link
3) 使用以下内容在项目的根目录中创建 jitpack.yml

#!/bin/bash

before_install:
- curl PASTE_RAW_LINK_TO_GIST | sh

4) 提交并推送

希望对您有所帮助

您可能 运行 进入:https://issuetracker.google.com/issues/123054726

作为解决方法,我单独安装了它。即

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

修复了我们的 CI 构建,添加 yes |在安装系统映像、平台和构建工具之前。

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

要消除此错误,关闭 android studio 然后再次 运行 android studio 但这次 运行 作为管理员

重新安装sdk可以解决这个错误。在 Android studio 上,转到工具 > SDK 管理器卸载该 sdk 并重新安装。