Skip to content

Commit bf88fac

Browse files
authored
Turn off validateReferences for the iOS Resolver (#743)
1 parent 8cf54b6 commit bf88fac

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

plugin/Assets/ExternalDependencyManager/Editor/Google.IOSResolver.dll.meta

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/ExportUnityPackage/export_unity_package.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,10 @@ def importer_metadata(self):
18511851
if "Android" in platforms and cpu_string != "AnyCPU":
18521852
importer_metadata = Asset.set_cpu_for_android(
18531853
importer_metadata, cpu_string)
1854+
# Set validateReferences, if requested, which should be either 0 or 1
1855+
validateRef = safe_dict_get_value(self._json, "validateReferences", default_value=2)
1856+
if validateRef == 0 or validateRef == 1:
1857+
importer_metadata["PluginImporter"]["validateReferences"] = validateRef
18541858
else:
18551859
raise ProjectConfigurationError(
18561860
"Unknown importer type %s for package %s, paths %s" % (

source/IOSResolver/src/IOSResolver.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -843,25 +843,41 @@ public static void SettingsDialog() {
843843
/// </summary>
844844
internal static bool MultipleXcodeTargetsSupported {
845845
get {
846-
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
847-
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
846+
try {
847+
return MultipleXcodeTargetsSupportedInternal();
848+
} catch (Exception e) {
849+
return false;
850+
}
848851
}
849852
}
850853

854+
private static bool MultipleXcodeTargetsSupportedInternal() {
855+
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
856+
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
857+
}
858+
851859
/// <summary>
852860
/// Name of the Xcode main target generated by Unity.
853861
/// </summary>
854862
public static string XcodeMainTargetName {
855863
get {
856-
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
857-
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
858-
// so we'll use this constant as a relatively safe default.
859-
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
860-
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
861-
"GetUnityTargetName", null);
864+
try {
865+
return XcodeMainTargetNameInternal();
866+
} catch (Exception e) {
867+
return "Unity-iPhone";
868+
}
862869
}
863870
}
864871

872+
private static string XcodeMainTargetNameInternal() {
873+
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
874+
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
875+
// so we'll use this constant as a relatively safe default.
876+
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
877+
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
878+
"GetUnityTargetName", null);
879+
}
880+
865881
/// <summary>
866882
/// Name of the Xcode UnityFramework target generated by Unity 2019.3+
867883
/// </summary>

0 commit comments

Comments
 (0)