Jitpack:由于某些许可证尚未接受,因此无法安装以下Android SDK软件包

时间:2019-01-19 14:26:21

标签: android jitpack

我已经在Google上搜索过,有些人说经过几次尝试并通过创建新版本已将其修复,但是它似乎对我不起作用。

我该如何解决?

* 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

6 个答案:

答案 0 :(得分:5)

您可能遇到过: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"

答案 1 :(得分:0)

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

否则,请转到Android Studio,然后转到Android Studio>首选项>外观和行为>系统设置> Android SDK。选择具有API级别27的Android 8.1并安装它。

希望这会有所帮助。

答案 2 :(得分:0)

我遇到了同样的问题,呃花了几个小时才终于找到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)获取与此文件的原始链接
3)使用以下内容在项目的根目录中创建jitpack.yml

#!/bin/bash

before_install:
- curl PASTE_RAW_LINK_TO_GIST | sh

4)提交并推送

希望这会有所帮助

答案 3 :(得分:0)

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

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

答案 4 :(得分:0)

要摆脱此错误,请关闭android studio ,然后再次运行android studio,但这一次,以管理员身份运行

答案 5 :(得分:0)

重新安装sdk可以解决这个错误。在 Android studio 上,转到 Tool > SDK manager 卸载该 sdk 并重新安装。