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

Issue related with flavorDimensions

IlyaPavlik opened this issue · comments

If the project has several flavorDimensions the project won't be built.

Example:

apply plugin: 'com.ydq.android.gradle.native-aar.import'

flavorDimensions 'type1', 'type2'

productFlavors {
    flavor1 {
        dimension 'type1'
    }
    flavor2 {
        dimension 'type1'
    }
    flavor3 {
        dimension 'type2'
    }
    flavor4 {
        dimension 'type2'
    }
}

Cause of the issue might be combined flavor names and this name is used for finding product flavor for a variable (gradleMk ).

gradleMk = android.productFlavors.getByName(variant.flavorName).nativeBundleImport.ANDROID_GRADLE_NATIVE_BUNDLE_PLUGIN_MK

What's your environment

Gradle 7.2 (plugin: 7.0.2)
SDK compile: 30

Sorry, the plugin is not support gradle 7.2 currently and new version is coming soon

Sorry, the plugin is not support gradle 7.2 currently and new version is coming soon

looking forward to it

Please try 1.1.0

Unfortunatelly the new version doesn't work for me.
Build failed:

java.lang.NullPointerException: Cannot get property 'configurationModel' on null object
Caused by: java.lang.NullPointerException: Cannot get property 'configurationModel' on null object
	at com.yy.android.gradle.nativedepend.GradleApiAdapter.addArgumentToNativeBuildOption(GradleApiAdapter.groovy:98)
	at com.yy.android.gradle.nativedepend.GradleApiAdapter$addArgumentToNativeBuildOption.call(Unknown Source)
	at com.yy.android.gradle.nativedepend.NativeBundleImportPlugin$_apply_closure1.doCall(NativeBundleImportPlugin.groovy:79)

What's your environment

I've updated the gradle plugin, so now it's 7.0.3, but with 7.0.2 the issue with 'configurationModel' is still reproducable.

My demo is OK(https://github.com/howardpang/nativeBundleDemo); Can you show your build.gradle.

Thanks for demo. I've reproduced the issue with your demo.

To reproduce the issue you need use only
'com.ydq.android.gradle.native-aar.import'
And remove/comment externalNativeBuild block in each flavor

Example: build.txt

In my project I implemented externalNativeBuild in defaultConfig block

Thanks, i have reproduced the issue, and will resolve it later

Try 1.1.1

It works now, thank you!