When exporting android project with early version, ie. Unity 2020, removing the first comment line will prevent overwriting when exporting again. Like this:
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
apply plugin: 'com.android.library'
....
But when I upgrade to Unity 2021.3 (LTS),this line is gone and overwriting always happens .
Now I have to enable custom-gradle in Unity project and export again and again whenever I changed the gradle. It’s a inefficient way.
Is there any option to prevent Uity2021 from overwriting gradle files exist in android project ?