1. 程式人生 > >解決Studio升級產生的bug:No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

解決Studio升級產生的bug:No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

我匯入一個別人的產生這個問題,上網檢視到一篇不錯的解決方案,傳送帶,我也在這總結一下。

導致問題產生的原因,是因為專案中有使用了bintray-release ,把相應引用的程式碼註釋掉就能正常編譯通過了。

以下是有關注釋的程式碼段:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
//        classpath 'com.novoda:bintray-release:0.5.0'
    }
    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files
}
//apply plugin: 'com.novoda.bintray-release'//新增JCenter外掛

//publish {
//    userOrg = 'contrarywind'//bintray.com 使用者名稱/組織名 user/org name
//    groupId = 'com.contrarywind'//JCenter上顯示的路徑 path
//    artifactId = 'Android-PickerView'//專案名稱 project name
//    publishVersion = '4.1.6'//版本號 version code
//    desc = 'this is a pickerview for android'//專案描述 description
//    website = 'https://github.com/Bigkoo/Android-PickerView' //專案網址連結 link
//}

注意:所有Module裡的有關bintray-release 都註釋掉。