I have an android project with a few submodules. Each of these submodules are android libraries themselves and are also gradle projects. The main project has a gradle/wrapper with the latest version of gradle and this gets updated often as and when new android gradle plugin versions come out. However the submodules have their own gradle/wrapper and these aren’t update at all. I haven’t paid attention to this setup this far because it has worked.
I recently updated my android gradle plugin version to 3.1.0 and the gradle wrapper version to 4.4. This gave me an error
No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage in one of the submodules. The submodule gradle version is 3.2 and the android gradle plugin version is 2.3.0.
I have a few questions about such a setup:
- While building the app module do the submodules use the gradle wrapper in the app module or the ones in the respective submodules?
- What is the idiomatic way to have such a setup?
- According to https://docs.gradle.org/current/userguide/gradle_wrapper.html we can add a
wrapperextension to configure the gradle wrapper. How do we or is it possible to use this and mention a version so that all modules use the same gradle version and android gradle plugin version?