Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Error: build scan was not published

I am building basic app in Kotlin. I have added a listview and it was working fine. but when I try to implement google map then I got following error in 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'.

I have tried every available solution on the net like:

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

I have also added the plugin: apply plugin: com.gradle.build-scan but no luck.

like image 878
Rajinder Avatar asked May 16 '18 16:05

Rajinder


2 Answers

Just remove the following code from build.gradle file and Sync your Gradle again. Everything will be resolved.

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

buildScan {
    licenseAgreementUrl = 'https://gradle.com/terms-of-service'
    licenseAgree = 'yes'
}
like image 57
Avnish Choudhary Avatar answered Oct 24 '22 22:10

Avnish Choudhary


The accepted answer in this other question works. You have to test the existence of buildScan task.

if (hasProperty('buildScan')) {
    buildScan {
        termsOfServiceUrl = 'https://gradle.com/terms-of-service'
        termsOfServiceAgree = 'yes'
    }
}
like image 21
muthuraj Avatar answered Oct 24 '22 22:10

muthuraj