jeppeman / GloballyDynamic

Dynamic Delivery everywhere through a common API
Apache License 2.0
298 stars 18 forks source link

Gradle version compatibility ? #121

Closed vhaudiquet closed 1 month ago

vhaudiquet commented 1 month ago

Description

During gradle sync, I get the following warning :

Tasks for project ':app' cannot be collected due to plugin exception.

org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:buildUniversalApkForDebug'.

(full warning log attached warning_log.txt)

This 'Tasks collecting failure' seems to happen because of :

Caused by: java.lang.NoSuchMethodError: 'void com.android.build.gradle.internal.services.ProjectServices.<init>(com.android.build.gradle.internal.errors.SyncIssueReporter, com.android.build.gradle.internal.errors.DeprecationReporter, org.gradle.api.model.ObjectFactory, org.gradle.api.logging.Logger, org.gradle.api.provider.ProviderFactory, org.gradle.api.file.ProjectLayout, com.android.build.gradle.options.ProjectOptions, org.gradle.api.services.BuildServiceRegistry, com.android.build.gradle.internal.lint.LintFromMaven, com.android.build.gradle.internal.res.Aapt2FromMaven, int, com.android.build.gradle.internal.scope.ProjectInfo, kotlin.jvm.functions.Function1, org.gradle.api.artifacts.ConfigurationContainer, org.gradle.api.artifacts.dsl.DependencyHandler, org.gradle.api.plugins.ExtraPropertiesExtension)'

It leads me to think that my version of gradle does not have this ProjectServices constructor.

Having quickly read your code, I think this line uses that constructor, which might be removed in my version of gradle (if it is too recent) or not yet present ?

Later on, when I try to build my app, I get :

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:writeGloballyDynamicConfigurationSourceFilesForDebug'.
> Collection contains no element matching the predicate.

which I think originates from the sync warning.

Steps to Reproduce

My gradle version is 8.7. If you want, I can try to downgrade/upgrade ; maybe I can try with a version that you know is compatible ?

EDIT: I tried to downgrade, but I use other plugins that depend on Gradle 8.7+, so it might need a little bit more work from me

To reproduce, just create a globallydynamic project with Gradle 8.7 (kotlin project for me, with kotlin DSL), and try to sync/build.

GloballyDynamic gradle plugin version

globallydynamic-plugin = "1.7.0"

GloballyDynamic android library version

globallydynamic-lib = "1.3.0"

GloballyDynamic android studio plugin version

I don't have the Android Studio plugin yet because of #120

Android Studio Version

Koala Feature Drop | 2024.1.2

Let me know if you want more information / if you want me to try something. I don't have yet a repo because I'm just starting on a new version of an app, so I don't even have an initial commit. Thank you !

jeppeman commented 1 month ago

👍 Will look into this also

jeppeman commented 1 month ago

I've published version 1.8.0 now, it should be resolved there.

vhaudiquet commented 1 month ago

Thank you ! I just tested it and it works fine