diff --git a/CHANGELOG.md b/CHANGELOG.md index 923ed3c6..7238a5dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/source/AndroidResolver/src/PlayServicesResolver.cs b/source/AndroidResolver/src/PlayServicesResolver.cs index 74a011bb..569c7995 100644 --- a/source/AndroidResolver/src/PlayServicesResolver.cs +++ b/source/AndroidResolver/src/PlayServicesResolver.cs @@ -2352,7 +2352,13 @@ internal static IList PackagingOptionsLines(ICollection depe var sortedExcludeFiles = new List(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