An androidDeviceTest task in a Kotlin Multiplatform library can fail with “requires a placeholder substitution but no value … is provided” even when the library configuration supplies the Manifest placeholder. Google tracked this as an Android Gradle Plugin 9.0.0 issue involving com.android.kotlin.multiplatform.library.
Representative error
Execution failed for task ':library:processAndroidDeviceTestManifest'.
> Manifest merger failed:
AndroidManifest.xml requires a placeholder substitution
but no value for <exampleDataPlaceholder> is provided.
The task, Manifest path, and placeholder name vary by project.
Cause
In the affected AGP 9.0.0 KMP library implementation, a Manifest placeholder configured for the library was not always propagated to the Manifest-processing task for androidDeviceTest. The normal build could therefore resolve the value while the device-test Manifest merger treated it as missing.
Affected conditions and versions
- The project applies
com.android.kotlin.multiplatform.library. - A Manifest references a value such as
${exampleDataPlaceholder}. - An
androidDeviceTesttask is being run. - The project uses the affected Android Gradle Plugin 9.0.0 implementation.
Google lists Issue #482293927 as fixed in Android Gradle Plugin 9.2.0.
Recommended resolution
- Identify the current AGP version: Check the root
build.gradle(.kts)file or version catalog. - Upgrade to AGP 9.2.0 or later: Align Gradle, the JDK, and the Kotlin Gradle Plugin with the official compatibility table.
- Sync the project: Run Sync Project with Gradle Files in Android Studio.
- Run the failing task again: Use
./gradlew androidDeviceTestor the actual module-specific device-test task. - Inspect the result: Confirm that Manifest merging succeeds and the test APK is built and executed.
Compatibility note: Updating AGP without its required toolchain can introduce unrelated failures. AGP 9.2.0 lists Gradle 9.4.1, JDK 17, and Kotlin Gradle Plugin 2.2.10 as its baseline versions.
Alternatives when an upgrade is not yet possible
- Provide the same value explicitly in device-test Manifest or test configuration and verify that it reaches the merger.
- Separate a placeholder reference that is unnecessary for device tests from the test Manifest.
- Validate the fixed AGP on a dedicated CI branch before changing the primary build.
These are configuration-dependent workarounds. Updating to a version containing Google’s fix is the confirmed long-term resolution.
How to verify the fix
- Record the Gradle and JDK versions with
./gradlew --version, and confirm the configured AGP version. - Run the relevant task, such as
./gradlew :library:androidDeviceTest --stacktrace. - Verify that the output no longer contains
requires a placeholder substitution. - Confirm that the test APK installs and produces test results on the target device.
Cautions
The same message is valid when a placeholder is genuinely missing. If it persists with a fixed AGP version, check spelling and case, build-type and flavor selection, and the scope in which the value is configured. Do not place secrets directly in a Manifest as a workaround.
Summary
If only androidDeviceTest in an AGP 9.0.0 KMP library reports a missing Manifest placeholder, the build may be hitting Google’s known propagation bug. Upgrade to AGP 9.2.0 or later with a compatible toolchain, then rerun the same test task to verify the resolution.
