6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android Studio 3.4.0に上げたら怒られたこと

Last updated at Posted at 2019-04-18

Android Studio。あげられるようになったら上げるだろ?

怒られた..

Gradle DSL method not found: 'destination()'

😹

原因

The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File)

Android Studio 3.4.0に上げた際にこの部分のDeprecatedが許容してくれなくなっていた

なので、以下のように直した

既存↓

jacocoTestReport {
    group = "Reporting"
    reports {
        xml.enabled true
        html.enabled true
        csv.enabled false
        xml.destination "${buildDir}/reports/coverage"
        html.destination "${buildDir}/reports/coverage"
    }
}

解決↓

jacocoTestReport {
    group = "Reporting"
    reports {
        xml.enabled true
        html.enabled true
        csv.enabled false
        xml.destination file("${buildDir}/reports/coverage")
        html.destination file("${buildDir}/reports/coverage")
    }
}

file()でくくってあげることで、型を変えるってだけでした。
R8関連で躓くかと思いきや、まさかのこれ。

deprecated放置したのがいけないんですけどね。😇

ちなみにこういう風に書いている場合も同じくfile()で括ってあげればOK👍

        xml.enabled true
        html.enabled true
        csv.enabled false
        xml{
            destination "${buildDir}/reports/coverage"
        }
        html{
            destination "${buildDir}/reports/coverage"
        }

good luck

6
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?