getsentry / sentry-android-gradle-plugin

Gradle plugin for Sentry Android. Upload proguard, debug files, and more.
https://docs.sentry.io/platforms/android/gradle/
MIT License
142 stars 32 forks source link

Incompatible with Gradle Configuration Cache #39

Closed PaulWoitaschek closed 3 years ago

PaulWoitaschek commented 3 years ago

The sentry gradle plugin ins incompatible with the gradle configuration cache. https://docs.gradle.org/current/userguide/configuration_cache.html

The stacktrace is as follows:

81 problems were found storing the configuration cache, 3 of which seem unique.
- Task `:app:addSentryProguardSettingsForPlayRelease` of type `io.sentry.android.gradle.SentryProguardConfigTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.8.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:app:addSentryProguardSettingsForPlayRelease` of type `io.sentry.android.gradle.SentryProguardConfigTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.8.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:app:addSentryProguardSettingsForPlayRelease` of type `io.sentry.android.gradle.SentryProguardConfigTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer', a subtype of 'org.gradle.api.artifacts.ConfigurationContainer', as these are not supported with the configuration cache.
  See https://docs.gradle.org/6.8.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
See the complete report at file:///builds/yazio/android/app/build/reports/configuration-cache/een4gb9jxnugr2xi1hjizyb6g/configuration-cache-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Configuration cache state could not be cached: field 'applicationVariant' from type 'io.sentry.android.gradle.SentryProguardConfigTask': error writing value of type 'com.android.build.gradle.internal.api.ApplicationVariantImpl'
> Configuration cache state could not be cached: field 'unitTestVariant' from type 'com.android.build.gradle.internal.api.ApplicationVariantImpl': error writing value of type 'com.android.build.gradle.internal.api.UnitTestVariantImpl'

I'm using the following versions:

marandaneto commented 3 years ago

@PaulWoitaschek thanks for reporting, yes, we are currently planning a full rewrite of this plugin #2

marandaneto commented 3 years ago

https://docs.gradle.org/current/userguide/configuration_cache.html

The configuration cache is an incubating feature, and the details described here may change.

let's wait a bit more before working on it as its still incubating

marandaneto commented 3 years ago

should be fixed by #166 and #165, can you test it out with the latest version @PaulWoitaschek ? thanks

tested with Sentry Android Gradle Plugin 2.1.4, AGP 7.0.1, Gradle 7.2

marandaneto commented 3 years ago

you may need to treat errors as warnings though, due to an AGP issue:

org.gradle.unsafe.configuration-cache-problems=warn

1 problem was found storing the configuration cache.

but that's not Sentry Android Gradle Plugin's fault