Android开发笔记-License for package Android SDK Platform 28 not accepted

  开发项目时,碰到持续集成工具CircleCI上报了一个Android SDK异常,如下:

> Configure project :app
useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.
useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.
Checking the license for package Android SDK Platform 28 in /opt/android/sdk/licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-28 Android SDK Platform 28
  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

* 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 37s

解决办法:

    1.1 检查项目中的版本当前是27,改成28(注意如果有多个component是27的,建议一个一个的改,然后build,如果全部一块改了,然后build,很可能不成功,实测验证)

1.2 安装对应的证书,找到安装SDK的路径如:\AppData\Local\Android\Sdk\tools\bin>,cmd后执行:
  sdkmanager --licenses
  一路点击 yes

你可能遇到:
  .android\repositories.cfg could not be loaded

解决办法:在.android目录下新建一个repositories.cfg 文件

1.3 检查.yml文件中对应发布的阶段版本,是不是你最新的版本,无误后,然后重新上传代码。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值