Sentry Android Gradle plugin is not compatible with Gradle 8.0
Gradle Version
8.0
AGP Version
any
Code Minifier/Optimizer
No response
Version
3.1.4
Sentry SDK Version
any
Steps to Reproduce
-
git clone [email protected]:asodja/io-sentry-with-gradle8.git -
./gradlew :validatePluginWithId_io_sentry_android_gradle
Expected Result
The build is successful.
Actual Result
Build fails with:
Execution failed for task ':validatePluginWithId_io_sentry_android_gradle'.
> Plugin validation failed with 2 problems:
- Error: Type 'io.sentry.android.gradle.tasks.SentryUploadNativeSymbolsTask' property 'buildDir' has @Input annotation used on property of type 'DirectoryProperty'.
Reason: A property of type 'DirectoryProperty' annotated with @Input cannot determine how to interpret the file.
Possible solution: Annotate with @InputDirectory for directories.
Please refer to https://docs.gradle.org/7.7-20220819221134+0000/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.
- Error: Type 'io.sentry.android.gradle.tasks.SentryUploadProguardMappingsTask' property 'uuidDirectory' has @Input annotation used on property of type 'DirectoryProperty'.
Reason: A property of type 'DirectoryProperty' annotated with @Input cannot determine how to interpret the file.
Possible solution: Annotate with @InputDirectory for directories.
Please refer to https://docs.gradle.org/7.7-20220819221134+0000/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.
See https://docs.gradle.org/7.7-20220819221134+0000/userguide/more_about_tasks.html#sec:task_input_output_annotations for more information on how to annotate task properties.
Context: Gradle 8 will have more strict validation for annotations applied to file/directory types: https://github.com/gradle/gradle/pull/21153.
That's a valid report. The fix should be as easy as updating those two annotations to @InputDirectory:
https://github.com/getsentry/sentry-android-gradle-plugin/blob/106289f3f3fd0e33d603f1ed33983a498ff10612/plugin-build/src/main/kotlin/io/sentry/android/gradle/tasks/SentryUploadNativeSymbolsTask.kt#L22
https://github.com/getsentry/sentry-android-gradle-plugin/blob/106289f3f3fd0e33d603f1ed33983a498ff10612/plugin-build/src/main/kotlin/io/sentry/android/gradle/tasks/SentryUploadProguardMappingsTask.kt#L28
Thanks for raising this, we'll look into it but I can give no timeline yet.