I defined manifest placeholders for different variants using following code.
android.applicationVariants.all { variant ->
// def names = variant.getVariantData().getVariantConfiguration().getFlavorName()
def mergedFlv = variant.getVariantData().getVariantConfiguration().getMergedFlavor()
mergedFlv.manifestPlaceholders = [pl1: mergedFlv.getApplicationId() + mergedFlv.getApplicationIdSuffix()]
It was working well. But I updated to the latest version of Android Studio a week ago and also updated gradle version for this project when Android Studio prompted and the Android Studio throws following error.
No signature of method: com.android.build.gradle.internal.variant.ApplicationVariantData.getVariantConfiguration() is applicable for argument types: () values: []
How do I fix this?
Update
I found this class at https://android.googlesource.com/platform/tools/build/+/0d498ccf6f91a12c036b382b7ae2b1a809eb2b9d/gradle/src/main/groovy/com/android/build/gradle/internal/variant/ApplicationVariantData.java
It does not have getVariantConfiguration() method. But it is extending ApkVariantData class which in turn is extending BaseVariantData. BaseVariantData has this public method getVariantConfiguration()
Thus it should be accessible. I closed and reopened project as well as android studio and tried building project again too... Doesn't seem to work.
Any help please