Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

Android Studio compile error:

Error:No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

Can`t fix this problem for 2 days .

like image 240
Fr099y Avatar asked Nov 24 '17 09:11

Fr099y


3 Answers

Please check your Android system log. Usually it located at:

For Windows:

C:\User\yourusername\\.AndroidStudio3.1\system\log\idea.log

I encounter the same issue, and I got this error log:

Caused by: groovy.lang.MissingPropertyException: No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

It means you have to upgrade the com.novoda.bintray-release to the latest version

dependencies {
        classpath 'com.novoda:bintray-release:0.8.0'
}
like image 62
Creatividia Avatar answered Sep 26 '22 20:09

Creatividia


Just remove this line: apply from: '../api.attributes

in your library's build gradle of your android project

like image 34
Balaji JB Avatar answered Sep 24 '22 20:09

Balaji JB


Finally, I have solved it. In my case, I was using Gradle local distribution so I changed it to use default gradle wrapper. And update your gradle to latest version in your project by simply copy the latest version and paste it to your project file.

like image 41
Rashid Kamal Avatar answered Sep 25 '22 20:09

Rashid Kamal