8

我在谷歌上搜索过,有人说经过几次尝试并通过创建一个新版本来修复它,但它似乎对我不起作用。

我该如何解决这个问题?

* 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

4

6 回答 6

6

您可能遇到过:https ://issuetracker.google.com/issues/123054726

作为一种解决方法,我单独安装了它。IE

$ yes | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-27"
$ yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;27.0.3"
于 2019-01-21T14:55:26.823 回答
2

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

如果没有,请转到 Android Studio,然后转到 Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK。选择具有 API 级别 27 的 Android 8.1 并安装它。

希望这可以帮助。

于 2019-01-20T21:18:14.643 回答
2

我遇到了同样的问题,呃花了几个小时才终于找到解决方案

简而言之:

1)使用此内容创建一个私人要点: 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)提交和推送

希望这可以帮助

于 2019-01-21T03:16:44.340 回答
0

这修复了我们的 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
于 2019-01-22T21:42:10.940 回答
0

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

于 2021-03-09T02:43:12.313 回答
-1

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

于 2019-09-06T11:14:17.050 回答