I'm using the manifestPlaceholder tag in the build.gradle file for a library project.
The person who uses the library should define it properly.
AndroidManifest.xml in Library:
<meta-data
android:name="library_id"
android:value="${libraryId}"/>
Build.gradle file on the application side:
manifestPlaceholders = [libraryId: "example"]
Is there any option to override the manifestPlaceholder tag on the library side?
I just want to define a default value and user should be free to provide a value if he wants to change it.
xml file in the directory structure. Android Manifest usually contains pre-defined or static information which is then used to run the app. However, Android toolchain provides customization by allowing you to specify dynamic information through variable declaration, generally referred as Android Manifest placeholders.
The Android manifest file is a specially formatted XML file. You can edit the XML manually by clicking on the AndroidManifest. xml tab. Android manifest files generally include a single <manifest> tag with a single <application> tag.
Inspect the merged manifest and find conflicts Even before you build your app, you can see a preview of what your merged manifest looks by opening your AndroidManifest. xml file in Android Studio, and then clicking the Merged Manifest tab at the bottom of the editor.
The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.
Have you tried using a Manifest Merge strategy to get the desired effect?
On the app manifest you can add something like
<your-outer-element
tools:node="replace">
<meta-data
android:name="library_id"
android:value="YOUR_APP_ID"/>
</your-outer-element>
And that will replace the library_id
meta data found inside the your-outer-element
found in the library Manifest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With