The Android Templates Upgrader window is a tool that upgrades Gradle template files to use the Android Project Configuration Manager. To do this, it takes the Gradle template files in your project and creates a new C# script that uses the Android Project Configuration Manager API to make the same Gradle project file modifications as the Gradle template files. It then disables the Gradle template files.
To open the Android Templates Upgrader window:
Tip: It’s best practice to use this window as a one-time upgrade path. After you upgrade your Gradle template files, you should use the new C# script and the Android Project Configuration Manager API to make any further Gradle project file modifications.
プロパティ | 説明 |
---|---|
Custom Main Manifest | Indicates whether to upgrade your Main Manifest template file. This property is visible only when you enable Custom Main Manifest in Player Settings. |
Custom Launcher Manifest | Indicates whether to upgrade your Launcher Manifest template file. This property is visible only when you enable Custom Launcher Manifest in Player Settings. |
Custom Main Gradle Template | Indicates whether to upgrade your Main Gradle template file. This property is visible only when you enable Custom Main Gradle Template in Player Settings. |
Custom Launcher Gradle Template | Indicates whether to upgrade your Launcher Gradle template file. This property is visible only when you enable Custom Launcher Gradle Template in Player Settings. |
Custom Base Gradle Template | Indicates whether to upgrade your Base Gradle template file. This property is visible only when you enable Custom Base Gradle Template in Player Settings. |
Custom Gradle Properties Template | Indicates whether to upgrade your Gradle Properties template file. This property is visible only when you enable Custom Gradle Properties Template in Player Settings. |
Custom Gradle Settings Template | Indicates whether to upgrade your Gradle Settings template file. This property is visible only when you enable Custom Gradle Settings Template in Player Settings. |
Upgrade Templates | Upgrades the selected Gradle template files to use the Android Project Configuration Manager API. The upgrade process creates a new C# script that makes the same Gradle project file modifications as the selected Gradle template files. If the upgrade process succeeds, the window displays the path to the new C# script. If the upgrade process fails, the window displays an error. This button is interactive when you select at least one custom Gradle template file to upgrade. |
When the upgrader disables custom Gradle template files, it doesn’t delete them. This means that if you later want to use the Gradle template files again, you can delete the generated C# script and re-enable the relevant custom Gradle template options in Android Player Settings. This re-enables your Gradle template files which still perform the same modifications as they did before you ran the upgrader.
If you run the upgrader multiple times it creates a backup of the previously generated C# script. The backup is in the same directory and has the same name as the newly generated C# script. To differentiate the backup from the newly generated C# script, the file extension for the backup is .cs.BACKUP
.
Warning: Successive runs of the upgrader override the backup. This means if you make any changes in the backup file then run the upgrader, these changes will be lost.
Warning: If you use single quotes to define values for string properties in the gradle templates, these properties will use double quotes when exported to the Gradle project.
Warning: Unity supports two application entry points: Activity and GameActivity. If the file you want to upgrade contains modifications specifically for one entry point, but you don’t enable that entry point, the generated C# script won’t affect the disabled activity. The result is that the final AndroidManifest.xml
won’t include the modifications.
For example, if your template contains modifications specifically for the Activity application entry point, the template upgrader generates a script that also specifically modifies Activity. If you later switch to the GameActivity application entry point, the modifications have no effect.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.