Skip to content

Commit 5351241

Browse files
authored
add condition for checking AGP (#718)
1 parent 523887a commit 5351241

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Upcoming
2+
* Android Resolver - Update and resolve `packaging` keyword in maintemplate based on android gradle plugin version. Fixes #715
3+
14
# Version 1.2.183 - Sep 18, 2024
25
* Android Resolver - Handle package paths that don't include a version hash,
36
which is no longer present with Unity 6. Fixes #697

source/AndroidResolver/src/PlayServicesResolver.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -2352,7 +2352,13 @@ internal static IList<string> PackagingOptionsLines(ICollection<Dependency> depe
23522352
var sortedExcludeFiles = new List<string>(excludeFiles);
23532353
sortedExcludeFiles.Sort();
23542354
lines.Add("android {");
2355-
lines.Add(" packagingOptions {");
2355+
2356+
// `packagingOptions` is replaced by `packaging` keyword in Android Gradle plugin 8.0+
2357+
if ((new Dependency.VersionComparer()).Compare("8.0", AndroidGradlePluginVersion) <= 0) {
2358+
lines.Add(" packaging {");
2359+
} else {
2360+
lines.Add(" packagingOptions {");
2361+
}
23562362
foreach (var filename in sortedExcludeFiles) {
23572363
// Unity's Android extension replaces ** in the template with an empty
23582364
// string presumably due to the token expansion it performs. It's not

0 commit comments

Comments
 (0)