sto cercando di effettuare la sostituzione all'interno del file AndroidManifest.xml dall'estensione Android build.gradle ma sto ottenendo questo errore:Gradle "manifesta richiede una sostituzione segnaposto" errore, ma manifestPlaceholders fornisce un valore
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
si tratta di un frammento del file manifesto:
...
</receiver>
<uses-library android:name="com.company.platform.${encoding}" />
</application>
...
E questa è una tagliò del 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]
}
Ho anche provato ad aggiungere i manifestPlaceholders nelle buildTypes cioè
buildTypes {
release {
minifyEnabled true
shrinkResources true
manifestPlaceholders = [encoding: deviceEncoding]
manifestPlaceholders = [version: cityIDVersion]
}
debug {
manifestPlaceholders = [encoding: deviceEncoding]
manifestPlaceholders = [version: cityIDVersion]
}
}
Ma ho ancora ottenere lo stesso errore.
Perché è presente un errore in merito alla sostituzione di un segnaposto quando ne è previsto uno in manifestPlaceholders?
Grazie mille! –
risposta giusta per me – floatingmuseum