zoukankan      html  css  js  c++  java
  • Failed to install the following Android SDK packages as some licences have not been accepted.

    问题描述:

    执行gradle tasks报错: 

    gradle tasks
    
    > Configure project :app 
    Exception while marshalling /usr/local/android-home/android-sdk-linux/build-tools/28.0.3/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/build-tools/29.0.2/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platform-tools/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platforms/android-26/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platforms/android-27/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/tools/package.xml. Probably the SDK is read-only
    
    > Configure project :picture_library 
    Exception while marshalling /usr/local/android-home/android-sdk-linux/build-tools/28.0.3/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/build-tools/29.0.2/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platform-tools/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platforms/android-26/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/platforms/android-27/package.xml. Probably the SDK is read-only
    Exception while marshalling /usr/local/android-home/android-sdk-linux/tools/package.xml. Probably the SDK is read-only
    Checking the license for package Android SDK Build-Tools 28.0.2 in /usr/local/android-home/android-sdk-linux/licenses
    Warning: License for package Android SDK Build-Tools 28.0.2 not accepted.
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':picture_library'.
    > Failed to install the following Android SDK packages as some licences have not been accepted.
         build-tools;28.0.2 Android SDK Build-Tools 28.0.2
      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: /usr/local/android-home/android-sdk-linux
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1s

     分析错误信息:

    Failed to install the following Android SDK packages as some licences have not been accepted.
         build-tools;28.0.2 Android SDK Build-Tools 28.0.2
      To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

    得到以下结论:

    构建当前的项目缺少下面的android sdk

    所以下载这个sdk即可:

       build-tools;28.0.2 Android SDK Build-Tools 28.0.2

    解决办法:

    使用android命令 列出sdk相关的列表,以便我们选择和自己项目匹配的SDK版本 

    android list sdk --all

    输出如下所示:

     从上图可以看出,Android SDK Build-Tools 28.0.2对应的序号是7,使用android update命令安装:

    android update sdk -u -a -t 7

    安装完成:

    再次在app目录下,测试gradle clean命令,就执行成功了:

     

     

  • 相关阅读:
    实战,利用apache来做集群,实现负载均衡
    Paas
    mysql memcache
    JSP简单练习-定时刷新页面
    协定须要双工,可是绑定“WSHttpBinding”不支持它或者因配置不对而无法支持它
    ACM:图的BFS,走迷宫
    appium框架之bootstrap
    [JSP]JSP中include指令和include动作的差别
    cocos2d-x-3.1 win32程序-初识源代码(coco2d-x 学习笔记二)
    AT&T汇编语言——简单实例及工具演示
  • 原文地址:https://www.cnblogs.com/kaerxifa/p/11993583.html
Copyright © 2011-2022 走看看