microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
43 stars 17 forks source link

Intune plugin does not support Gradle's configuration cache #95

Open paul-turner opened 2 years ago

paul-turner commented 2 years ago

Describe the bug: When running a build with Gradle's configuration cache turned on the build will fail to apply the config cache due to the plugins usage of disallowed types.

To Reproduce Reproduced this in the Taskr sample app after upgrading the gradle version to 7.1.0. Steps to reproduce the behavior:

  1. Update Taskr to gradle 7.1.0
  2. Execute a build of the app using ./gradlew --configuration-cache assembleDebug
  3. See error:
    1 problem was found storing the configuration cache.
    - Task `:app:transformClassesWithMamifyTransformForDebug` of type `com.android.build.gradle.internal.pipeline.TransformTask`: 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/7.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

Expected behavior: Configuration cache should complete without discarding the cache entry.

Screenshots and logs:

FAILURE: Build failed with an exception.

1 problem was found storing the configuration cache.

See the complete report at file:///Users/pturner/nobackup/dev/Taskr-Sample-Intune-Android-App/build/reports/configuration-cache/2uonhwsi4i9jxufawmqjk3jip/65zgg7rd3oinrrk83jd5vsdqh/configuration-cache-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 765ms 28 actionable tasks: 28 up-to-date Configuration cache entry discarded with 1 problem.



**Intune App SDK for Android (please complete the following information):**
- What version of the Intune SDK are you using? Are you using the latest version? `8.3.0`, Yes
- What platform is your app based in (Java, Xamarin based, Cordova, etc)? Java/Kotlin, reproduced with sample Taskr app as well
- For errors during build, does the app build without Intune SDK integration? Yes
- For errors post build, does the app launch without being Intune SDK integrated? Yes
- Who is the customer? Slack

**Additional context:**
Please see the following guide https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage for additional information on how to patch the issue.
joakley-msft commented 2 years ago

Hi @paul-turner, thank you for the report. We are taking support for the configuration cache under advisement and are tracking internally as 13139839.

However please note that the Gradle docs you linked contain the warning:

This feature is currently highly experimental and not enabled by default. Not all core Gradle plugins are supported. Your build and the plugins you depend on might require changes to fulfil the requirements. Some Gradle features are not yet implemented. Importing and syncing Gradle builds in IDEs is not improved by configuration caching yet

ZacSweers commented 2 years ago

Hi @joakley-msft - That is a notice, not a warning. Configuration caching is fairly close to being the default, community plugins should be actively implementing support for it and I'd point out that intune's SDK is actually our last remaining plugin that hasn't implemented support yet. We actively have to isolate the plugin currently to CI only so as to limit its negative influence on local build times.

paul-turner commented 2 years ago

Yep sorry about that, I used the bug template out of convenience and should have updated the wording a bit. Any updates on development would be appreciated and as Zac mentions we are quickly approaching a time where configuration cache will become a norm in Android development.

SageEx commented 2 years ago

Hey @joakley-msft, any updates on supporting configuration cache for mam plugin?

bannus commented 2 years ago

@SageEx No ETA to share at this time, but we are still actively tracking this work.