Skip to content

Commit 42600cf

Browse files
authored
Improve logic around removeAll tag and newer gradle versions (#955)
* Check gradle versions to handle the property tag * Update AnalyticsFixPropertyRemover.cs * Update AnalyticsFixPropertyRemover.cs * Update AnalyticsFixPropertyRemover.cs * Update readme.md
1 parent 64bbd9b commit 42600cf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Release Notes
7373
-------------
7474
### Upcoming release
7575
- Changes
76+
- General (Android): Improve how property tag logic handles Unity 2022+.
7677
- Dynamic Links: The Dynamic Links SDK is now deprecated. See the [support
7778
documentation](https://firebase.google.com/support/dynamic-links-faq)
7879
for more information.

editor/app/src/AnalyticsFixPropertyRemover.cs

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ public void OnPreprocessBuild(BuildReport report) {
5656
return;
5757
}
5858

59+
// If the gradle version is newer than 7.0.0, which should have support
60+
// for the property tag, there is no reason to add the removeAll logic.
61+
var versionComparer = new Google.JarResolver.Dependency.VersionComparer();
62+
if (versionComparer.Compare(
63+
GooglePlayServices.PlayServicesResolver.AndroidGradlePluginVersion,
64+
"7.0.0") <= 0) {
65+
return;
66+
}
67+
5968
// Locate the AndroidManifest file.
6069
string androidPluginsDir = Path.Combine(Application.dataPath, "Plugins", "Android");
6170
string androidManifestPath = Path.Combine(androidPluginsDir, "AndroidManifest.xml");

0 commit comments

Comments
 (0)