Hilt plugin crash with android gradle plugin 7 beta04
See original GitHub issueVersions:
Android Studio Arctic Fox Beta 4 Android tools gradle plugin 7.0.0-beta04 kotlin gradle plugin 1.5.10 dagger 2.37
Gradle build fails when applying hilt plugin to the module:
plugins {
...
id("dagger.hilt.android.plugin")
...
}
Partial stacktrace
com/android/build/api/extension/AndroidComponentsExtension$DefaultImpls
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
java.lang.NoClassDefFoundError: com/android/build/api/extension/AndroidComponentsExtension$DefaultImpls
at dagger.hilt.android.plugin.HiltGradlePlugin.configureBytecodeTransformASM(HiltGradlePlugin.kt:258)
at dagger.hilt.android.plugin.HiltGradlePlugin.configureHilt(HiltGradlePlugin.kt:89)
at dagger.hilt.android.plugin.HiltGradlePlugin.access$configureHilt(HiltGradlePlugin.kt:59)
at dagger.hilt.android.plugin.HiltGradlePlugin$apply$1.execute(HiltGradlePlugin.kt:66)
at dagger.hilt.android.plugin.HiltGradlePlugin$apply$1.execute(HiltGradlePlugin.kt:59)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:112)
at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:95)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
EDIT If anyone needs a quick fix without downgrading AS it compiles without errors on alpha using Android Studio Bumblebee Canary 2 and AGP 7.1.0-alpha02.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:82
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Android Studio 2021.2.1 Closed Issues
Released together with: Android Gradle Plugin 7.2.0-beta04. Fixed Issues. Android Gradle Plugin ...
Read more >Error in gradle when implement hilt library in android
Stop Gradle build processes (requires restart) Your project may be using a third-party plugin which is not compatible with the other plugins in ......
Read more >Release Notes - Play services - Google Developers
The latest update to the OSS licenses Gradle plugin includes fixes for the following ... Firebase Android BoM (Bill of Materials); Firebase Crashlytics....
Read more >[오류수정] Unable to find method - My Knowledge Warehouse
프로젝트의 Android Gradle Plugin Version과 Gradle Version을 ... Gradle crashes with: Hilt + AGP 4.2.0-beta04 · Issue #2337 · google/dagger.
Read more >John O'Reilly on Twitter: "Also, just fyi that this is using ...
Versions: Android Studio Arctic Fox Beta 4 Android tools gradle plugin 7.0.0-beta04 kotlin gradle plugin 1.5.10 dagger 2.37 Gradle build fails ...
Read more >Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The Android Gradle Plugin team is aware of the issue and a fix for this will be available in AGP 7 beta05.
Sorry all for the issue, AGP is expected to have a release sometime next week for 7.0-beta, if all goes well. Meanwhile using 7.1-alpha02 should work.
And just for context, this is related to Hilt’s bytecode transform which uses AGP’s new ASM pipeline starting in 4.2 which is way more efficient and correct than the ‘previous’ version. The APIs for the ASM transform are planned to become stable soon in 7.0 so hopefully, in the near future this should be less of an issue.