googlesamples / googlesamples/unity-jar-resolver
Android - Support custom manifestPlaceholders in Dependencies.xml
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 371
- Avg merge
- 14h 21m
- Merged PRs (30d)
- 3
Description
## Issue
Some plugins have custom `manifestPlaceholders` that must be set, otherwise `AndroidManifest.xml` merge errors will occur at build time. These are normally set in the `app/build.gradle` for an Android Studio project.
**Example:**
```
android {
defaultConfig {
manifestPlaceholders = [
key1: 'value1',
key2: 'value2'
]
}
}
```
To be clear I am not referring to the `applicationId`, but custom placeholders.
## Possible Solutions
### Option 1
```xml
value1
value2
```
Since there will be a `PluginNameDependencies.xml` for each plugin this would a straightforward spot to put them.
### Option 2
A new `PluginNameManifestPlaceholders.xml` file each plugin could define. Since `manifestPlaceholders` are scoped to the gradle project this fits better into how gradle really defines `manifestPlaceholders`
### Option 3
Something build into Unity I am missing?
There does seem to be some kind of `settingsTemplate.gradle` file.
https://docs.unity3d.com/Manual/android-gradle-overview.html
However it seems like this does not automatic get imported according to this note from the link above.
> You can also use your own settings.gradle file by providing a settingsTemplate.gradle file in your Plugins directory in the same way (although there is currently no automatic way to do this).
Regardless I did try creating a `settingsTemplate.gradle` file however Unity didn't seem to pick it up.
@stewartmiles Maybe you have some experience with with this Unity feature already?
Contributor guide
Assessment
This issue has not been assessed yet.