Skip to content

Commit

Permalink
add condition for checking AGP (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
argzdev authored Jan 9, 2025
1 parent 523887a commit 5351241
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Upcoming
* Android Resolver - Update and resolve `packaging` keyword in maintemplate based on android gradle plugin version. Fixes #715

# Version 1.2.183 - Sep 18, 2024
* Android Resolver - Handle package paths that don't include a version hash,
which is no longer present with Unity 6. Fixes #697
Expand Down
8 changes: 7 additions & 1 deletion source/AndroidResolver/src/PlayServicesResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2352,7 +2352,13 @@ internal static IList<string> PackagingOptionsLines(ICollection<Dependency> depe
var sortedExcludeFiles = new List<string>(excludeFiles);
sortedExcludeFiles.Sort();
lines.Add("android {");
lines.Add(" packagingOptions {");

// `packagingOptions` is replaced by `packaging` keyword in Android Gradle plugin 8.0+
if ((new Dependency.VersionComparer()).Compare("8.0", AndroidGradlePluginVersion) <= 0) {
lines.Add(" packaging {");
} else {
lines.Add(" packagingOptions {");
}
foreach (var filename in sortedExcludeFiles) {
// Unity's Android extension replaces ** in the template with an empty
// string presumably due to the token expansion it performs. It's not
Expand Down

0 comments on commit 5351241

Please sign in to comment.