howardpang / androidNativeBundle

a gradle plugin that support publish c/c++ headers to 'aar' and depend those 'aar'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AGP 7.4 not supported

liedQM opened this issue · comments

With AGP 7.4 the internal API of the LibraryVariant has changed and therefor you receive the following error:

> No such property: variantDependencies for class: com.android.build.gradle.internal.variant.LibraryVariantData

I've already found a solution but I'm unable to push a branch and therefor I'll describe the fix here:

Add the following lines to GradleApiAdapter. getArtifactCollection(..):

        if (isAndroidGradleVersionGreaterOrEqualTo("7.4.0"))  {
            artifactCollection = variant.component.getVariantDependencies().getArtifactCollection(type, scope, artifactType)
        } else if (isAndroidGradleVersionGreaterOrEqualTo("4.1.0")) {

and it will work with AGP 7.4

commented

Thanks for your work, I will update the plugin later.

commented

Try 1.1.3