Can't set Manifest application tools:targetApi via manifest placeholder

27 Views Asked by At

I have multiple app modules in my app which are all configured to the same (global) compileSdk and targetSdk. I'd like to also set the manifest application tools:targetApi via that globally set variable. Ideally via a manifest placeholder.

Manifest:

<application
        android:name=".App"
        [...]
        tools:targetApi="${targetSdk}">
</application>

App build.gradle.kts:

val COMPILE_SDK = 34
[...]
defaultConfig {
   [...]
   manifestPlaceholders["targetSdk"] = COMPILE_SDK
}

However, the IDE is giving me a "Value is neither valid build code nor an integer" error and doesn't seem to run lint. Is setting this tooling setting from a manifest placeholder not supported or am I doing something wrong?

enter image description here

0

There are 0 best solutions below