I'm trying to perform substitution within the AndroidManifest.xml file from the build.gradle android extension but am getting this error:
AndroidManifest.xml:89:16 Error:
Attribute uses-library#com.company.platform.${encoding}@name at AndroidManifest.xml:89:16 requires a placeholder substitution but no value for <encoding> is provided.
/Users/Company/Desktop/Checkout/android/Project/app/src/main/AndroidManifest.xml:0:0 Error:
Validation failed, exiting
:app:processDebugManifest FAILED
This is a snippet of the manifest file:
...
</receiver>
<uses-library android:name="com.company.platform.${encoding}" />
</application>
...
And this is a snipped of the build.gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 23
targetSdkVersion 23
versionName cityVersion
setProperty("archivesBaseName", "City_$versionName")
manifestPlaceholders = [encoding: "some value"]
manifestPlaceholders = [version: cityVersion]
}
I've also tried adding the manifestPlaceholders in the buildTypes i.e.
buildTypes {
release {
minifyEnabled true
shrinkResources true
manifestPlaceholders = [encoding: deviceEncoding]
manifestPlaceholders = [version: cityIDVersion]
}
debug {
manifestPlaceholders = [encoding: deviceEncoding]
manifestPlaceholders = [version: cityIDVersion]
}
}
But I still get the same error.
Why is there an error about it requiring a placeholder substitution when one is provided for in the manifestPlaceholders?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…