diff --git a/plugin/Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta b/plugin/Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta
index 79931b0b..61e6db6c 100644
--- a/plugin/Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta
+++ b/plugin/Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta
@@ -12,6 +12,7 @@ PluginImporter:
executionOrder: {}
isPreloaded: 0
isOverridable: 0
+ validateReferences: 0
platformData:
- first:
Any:
diff --git a/source/ExportUnityPackage/export_unity_package.py b/source/ExportUnityPackage/export_unity_package.py
index 10c5651f..b8f16b5a 100755
--- a/source/ExportUnityPackage/export_unity_package.py
+++ b/source/ExportUnityPackage/export_unity_package.py
@@ -1851,6 +1851,10 @@ def importer_metadata(self):
if "Android" in platforms and cpu_string != "AnyCPU":
importer_metadata = Asset.set_cpu_for_android(
importer_metadata, cpu_string)
+ # Set validateReferences, if requested, which should be either 0 or 1
+ validateRef = safe_dict_get_value(self._json, "validateReferences", default_value=2)
+ if validateRef == 0 or validateRef == 1:
+ importer_metadata["PluginImporter"]["validateReferences"] = validateRef
else:
raise ProjectConfigurationError(
"Unknown importer type %s for package %s, paths %s" % (
diff --git a/source/IOSResolver/src/IOSResolver.cs b/source/IOSResolver/src/IOSResolver.cs
index ea312fde..a272810e 100644
--- a/source/IOSResolver/src/IOSResolver.cs
+++ b/source/IOSResolver/src/IOSResolver.cs
@@ -843,25 +843,41 @@ public static void SettingsDialog() {
///
internal static bool MultipleXcodeTargetsSupported {
get {
- return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
- "GetUnityMainTargetGuid", Type.EmptyTypes) != null;
+ try {
+ return MultipleXcodeTargetsSupportedInternal();
+ } catch (Exception e) {
+ return false;
+ }
}
}
+ private static bool MultipleXcodeTargetsSupportedInternal() {
+ return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
+ "GetUnityMainTargetGuid", Type.EmptyTypes) != null;
+ }
+
///
/// Name of the Xcode main target generated by Unity.
///
public static string XcodeMainTargetName {
get {
- // NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
- // longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
- // so we'll use this constant as a relatively safe default.
- return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
- (string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
- "GetUnityTargetName", null);
+ try {
+ return XcodeMainTargetNameInternal();
+ } catch (Exception e) {
+ return "Unity-iPhone";
+ }
}
}
+ private static string XcodeMainTargetNameInternal() {
+ // NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
+ // longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
+ // so we'll use this constant as a relatively safe default.
+ return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
+ (string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
+ "GetUnityTargetName", null);
+ }
+
///
/// Name of the Xcode UnityFramework target generated by Unity 2019.3+
///