Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 9.0 から非互換となるような deprecated な Gradle の機能が使用されている依存関係を更新する #36

Closed
private-yusuke opened this issue May 6, 2023 · 1 comment · Fixed by #43

Comments

@private-yusuke
Copy link
Member

概要

https://github.com/twin-te/twinte-android/actions/runs/4901944672/jobs/8753500168?pr=35#step:4:160 のように、動作が非互換となるような機能が利用されている旨が表示されることがある。

原因

e862e5d 時点で ./gradlew --stacktrace --warning-mode all assembleDebug を実行すると、以下のような出力が得られる。

The AbstractCompile.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 9.0. Please use the destinationDirectory property instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.0/userguide/upgrading_version_7.html#compile_task_wiring
        at org.gradle.api.tasks.compile.AbstractCompile.getDestinationDir(AbstractCompile.java:90)
        at org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated.getDestinationDir(Unknown Source)
        at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler$wireKotlinTasks$preJavaKotlinOutput$1.call(Android25ProjectHandler.kt:52)
        at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler$wireKotlinTasks$preJavaKotlinOutput$1.call(Android25ProjectHandler.kt:50)
        at org.gradle.api.internal.provider.DefaultProvider.calculateOwnValue(DefaultProvider.java:72)
        (以下略)

このログより、以下の行が原因となっていることがわかる。

classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")

この依存関係は以下の kotlinVersion という変数に依存している。

val kotlinVersion by extra("1.4.31")

解決方法

#30 を実施する前に依存関係のバージョンをガッと上げるタイミングで Kotlin のバージョンも上げることになり、そのタイミングで同時に解決されることが期待される。

@private-yusuke private-yusuke changed the title Gradle 9.0 から非互換となるような deprecated な Gradle の機能の使用をやめる Gradle 9.0 から非互換となるような deprecated な Gradle の機能が使用されている依存関係を更新する May 6, 2023
@private-yusuke
Copy link
Member Author

#41 によって Kotlin のバージョンが上がり、./gradlew --stacktrace --warning-mode all assembleDebug でスタックトレースが表示されることはなくなった。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant