Closed dzolnai closed 3 years ago
Running into the same problem as this. Couldn't resolve our multi-platform module when applying the new flag
We made a fix for this (https://github.com/google/dagger/commit/396be80ee3870628cc4cf6296aaadd588bec33e8), but sadly didn't make it into the release, can you try using a snapshot of the plugin to confirm it works?
Snapshots are available in https://oss.sonatype.org/content/repositories/snapshots/com/google/dagger/, you add a maven repo in the repositories
closure for plugins and depend on com.google.dagger:hilt-android-gradle-plugin:HEAD-SNAPSHOT
.
I can confirm it working with the HEAD-SNAPSHOT
version.
One minor correction on the comment above, this is the correct repository URL:
maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
Not sure why, but it does not seem to work for our project (not a KMP project) with the HEAD_SNAPSHOT
or it was broken in newest snapshots?
Using dependencyInsight I can see it's using
com.google.dagger:hilt-android-testing:HEAD-SNAPSHOT:20210701.225505-304
com.google.dagger:dagger:HEAD-SNAPSHOT:20210701.225355-564
com.google.dagger:hilt-android:HEAD-SNAPSHOT:20210701.225501-304
I still have the error:
Execution failed for task ':app:getDependencies'.
> Cannot change dependencies of dependency configuration ':app:DebugAndroidTestRuntimeClasspath' after it has been included in dependency resolution. Use 'defaultDependencies' instead of 'beforeResolve' to specify default dependencies for a configuration.
@eric-labelle you seem to be having a different issue, can you file a new bug and share more information about your setup? Like your build.gradle
and a trace running Gradle with --stacktrace
.
Thank you @danysantiago I just created a new issue with the most informations I was able to find after further investigation. https://github.com/google/dagger/issues/2744
I have the same problem on a casual android project with hilt and multiple modules. We've tried migrating back to enableExperimentalClasspathAggregation, but it breaks lint as for another issue I've seen.
Snapshot however works fine, but using it as production dependency doesn't feel right, @danysantiago is there a release date already?
Also upgrading to AGP 7 didn't help, had same issues, though lint went a bit further but broke on some local .aars.
Edit. Also the enableAggregatingTask seems to work fine on Macs, but not on Windows.
Closing as the fix for this was released in 2.38
Versions:
We have a Kotlin Multiplatform Module called
common
, which is then referenced from Android and iOS. In the Android app we include thiscommon
module. The app builds fine without the following code inbuild.gradle
:As soon as I add it, the next build after the Gradle sync fails with the following error:
omroep
is a flavor, which is set tortvNoord
in the current build variant.nl.stichtingrpo.news.common:common
is the package of the common module. Is this new setting not compatible with the 4.x versions of AGP or Kotlin Multiplatform? Let me know if you need any more info for resolving this.