Skip to content

Commit 6001cb4

Browse files
committed
Fix reflection exception because Unity added a new version of SetApplicationIdentifier()
1 parent ec022c0 commit 6001cb4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/AndroidResolver/src/UnityCompat.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private static int VersionFromAndroidSDKVersionsEnum(object enumValue, string fa
6464
//Fall back on auto if the enum value is not parsable
6565
return -1;
6666
}
67-
68-
// If the enumName is empty then enumValue was not represented in the enum,
67+
68+
// If the enumName is empty then enumValue was not represented in the enum,
6969
// most likely because Unity has not yet added the new version,
7070
// fall back on the raw enumValue
7171
if (String.IsNullOrEmpty(enumName)) return (int)enumValue;
@@ -462,7 +462,9 @@ private static string GetUnity56AndAboveApplicationIdentifier(BuildTarget buildT
462462
private static bool SetUnity56AndAboveApplicationIdentifier(BuildTarget buildTarget,
463463
string applicationIdentifier) {
464464
var setApplicationIdentifierMethod =
465-
typeof(UnityEditor.PlayerSettings).GetMethod("SetApplicationIdentifier");
465+
typeof(UnityEditor.PlayerSettings).GetMethod(
466+
"SetApplicationIdentifier",
467+
new[]{typeof(BuildTargetGroup), typeof(string)});
466468
if (setApplicationIdentifierMethod == null) return false;
467469
var buildTargetGroup = ConvertBuildTargetToBuildTargetGroup(buildTarget);
468470
if (buildTargetGroup == BuildTargetGroup.Unknown) return false;

0 commit comments

Comments
 (0)