sentry-android-gradle-plugin icon indicating copy to clipboard operation
sentry-android-gradle-plugin copied to clipboard

Sentry Android Gradle plugin is not compatible with Gradle 8.0

Open asodja opened this issue 3 years ago • 2 comments

Gradle Version

8.0

AGP Version

any

Code Minifier/Optimizer

No response

Version

3.1.4

Sentry SDK Version

any

Steps to Reproduce

  1. git clone [email protected]:asodja/io-sentry-with-gradle8.git
  2. ./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.

asodja avatar Aug 22 '22 12:08 asodja

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

cortinico avatar Aug 22 '22 12:08 cortinico

Thanks for raising this, we'll look into it but I can give no timeline yet.

adinauer avatar Aug 29 '22 13:08 adinauer