【问题标题】:Android Studio Error: build scan was not publishedAndroid Studio 错误:构建扫描未发布
【发布时间】:2018-05-16 16:11:02
【问题描述】:

我正在使用 Kotlin 构建基本应用程序。我添加了一个列表视图,它工作正常。但是当我尝试实现谷歌地图时,我在 android studio 3.1 中遇到了以下错误。

The build scan was not published due to a configuration problem.
    
   The Gradle Cloud Services license agreement has not been agreed to.
    
   To agree to the license, include the following in your root project's configuration:
    buildScan { licenseAgreementUrl = 'https://gradle.com/terms-of-service'; licenseAgree = 'yes' }
    
   For more information, please see https://gradle.com/scans/help/plugin-license.
    
   Alternatively, if you are using Gradle Enterprise, specify the server location.
    For more information, please see https://gradle.com/scans/help/plugin-enterprise-config.
    
   9:27:52 PM: Task execution finished 'signingReport'.

我已经尝试了网上所有可用的解决方案,例如:

buildScan {
  licenseAgreementUrl = "https://gradle.com/terms-of-service"
  licenseAgree = "yes"
}

我还添加了插件:apply plugin: com.gradle.build-scan 但没有运气。

【问题讨论】:

标签: android google-maps kotlin


【解决方案1】:

只需从 build.gradle 文件中删除以下代码并再次同步您的 Gradle。一切都会解决的。

apply plugin: 'com.gradle.build-scan'

buildScan {
    licenseAgreementUrl = 'https://gradle.com/terms-of-service'
    licenseAgree = 'yes'
}

【讨论】:

  • 是的,你是对的。我已经解决了这个问题,但你的答案是 100% 正确的。感谢您的回复。
  • 我的代码不包含任何这些行。我现在该如何解决?
【解决方案2】:

我刚刚同步了我的 gradle 文件,构建成功

【讨论】:

    【解决方案3】:

    The accepted answer in this other question works。你必须测试buildScan任务的存在。

    if (hasProperty('buildScan')) {
        buildScan {
            termsOfServiceUrl = 'https://gradle.com/terms-of-service'
            termsOfServiceAgree = 'yes'
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-15
      • 2014-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-31
      • 1970-01-01
      相关资源
      最近更新 更多