Skip to content

Hilt Gradle Plugin fails with AGP 9.0.0-alpha06 due to legacy variant APIs usage #4979

@ychescale9

Description

@ychescale9

This is one of the breaking changes in AGP 9 (see https://developer.android.com/build/releases/agp-preview):

An exception occurred applying plugin request [id: 'com.google.dagger.hilt.android']
> Failed to apply plugin 'com.google.dagger.hilt.android'.
   > API 'applicationVariants' is obsolete.
     It will be removed in version 10.0 of the Android Gradle plugin.
     The legacy variant API is disabled by default in AGP 9.0, but can be re-enabled by adding 
         android.enableLegacyVariantApi=true
     to this project's gradle.properties file.

Workaround: android.enableLegacyVariantApi=true android.newDsl=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions