2

I want to change what was previously a library (com.android.library) to a feature module (com.android.dynamic-feature). However, when I do so, I am unable to set the targetSdk or targetSdkVersion:

plugins {
    id("com.android.dynamic-feature")
    kotlin("kapt")
    kotlin("android")
}

android { // this = DynamicFeatureExtension
    compileSdk = BuildConfig.SdkVersion.COMPILE

    defaultConfig {
        minSdk = BuildConfig.SdkVersion.MIN
        targetSdk = BuildConfig.SdkVersion.TARGET // targetSdk is not found
        targetSdkVersion(BuildConfig.SdkVersion.TARGET) // targetSdkVersion is not found
    ...
}

The gradle version is 7.0.2: distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

I notice that when I compare it with the Plaid App, which doesn't suffer the same problems, that their gradle version is 5.6.4.

Villa
  • 459
  • 7
  • 17

1 Answers1

0

Can you try this?

defaultConfig.apply {
        minSdk = BuildConfig.SdkVersion.MIN
        targetSdk = BuildConfig.SdkVersion.TARGET
        targetSdkVersion(BuildConfig.SdkVersion.TARGET)
}