I need to have a separate CMakeLists.txt for each Android ABI. I tried to use product flavor to set the path for CMakeLists.txt. But I am getting following error on running ./gradlew assembleDebug
or any other gradle command from command line.
Could not find method path() for arguments [CMakeLists.txt] on object of type com.android.build.gradle.internal.dsl.ExternalNativeCmakeOptions.
Here is how I have set product flavor in build.gradle.
productFlavors {
arm64_v8a {
ndk {
abiFilters "arm64-v8a"
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
x86_64 {
ndk {
abiFilters "x86_64"
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
}
NOTE - I had initially named the files as "CMakeLists_arm64-v8a.txt" and "CMakeLists_x86_64.txt". But that was failing so tried same name.
How to fix this or is there a workaround for this?