question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle crashes with: Hilt + AGP 4.2.0-beta04

See original GitHub issue

Versions: Hilt 2.31.2-alpha AGP 4.2.0-beta04 Gradle 6.8.1

Partial stacktrace:

FAILURE: Build failed with an exception.

* What went wrong:
com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTest$default(Lcom/android/build/api/extension/AndroidComponentsExtension;Lcom/android/build/api/extension/VariantSelector;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
java.lang.NoSuchMethodError: com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTest$default(Lcom/android/build/api/extension/AndroidComponentsExtension;Lcom/android/build/api/extension/VariantSelector;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
        at dagger.hilt.android.plugin.HiltGradlePlugin.configureTransformASM(HiltGradlePlugin.kt:224)
        at dagger.hilt.android.plugin.HiltGradlePlugin.configureHilt(HiltGradlePlugin.kt:74)
        at dagger.hilt.android.plugin.HiltGradlePlugin.access$configureHilt(HiltGradlePlugin.kt:47)
        at dagger.hilt.android.plugin.HiltGradlePlugin$apply$1.execute(HiltGradlePlugin.kt:52)
        at dagger.hilt.android.plugin.HiltGradlePlugin$apply$1.execute(HiltGradlePlugin.kt:47)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:100)
        at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:95)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:35
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

38reactions
micHarcommented, May 31, 2021

2.35.1 worked on com.android.tools.build:gradle:7.0.0-beta02, 2.36 works on com.android.tools.build:gradle:7.0.0-beta03

27reactions
superus8rcommented, Jun 17, 2021

using AGP 7.0.0-beta04 and Hilt 2.37, the same issue seems to persist…

Read more comments on GitHub >

github_iconTop Results From Across the Web

When adding hilt dependency the realm database crashes
After I added hilt dependencies in the gradle the app crashes and it happens while performing operation on realm database. I am using...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Starting with version 4.2, Android Studio now runs on JDK 11. ... Apps using the Database Inspector may crash when running on the...
Read more >
Gradle Build Setup - Dagger
When the Android Gradle plugin (AGP) version used in the project is less than 4.2, then the Hilt Gradle plugin by default, will...
Read more >
com.android.tools.build:gradle:4.2.0 broke manifest ...
We have the same issue with manifestPlaceholders after upgrading to AGP 4.2.1. The same gradle config works in 4.1.2 and fails in 4.2.1...
Read more >
AGP 7.0: Next major release for the Android Gradle plugin
In fact, in AGP 4.2 some of these APIs have changed. The APIs that are currently incubating do not follow the deprecation cycle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found