Skip to content

Turn off validateReferences for the iOS Resolver #743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged

Conversation

a-maurice
Copy link
Collaborator

By default, DLLs imported into Unity will validate all their references at load time. The iOS Resolver depends on the Unity iOS Support Library being present, which is not true by default for Windows developers. By turning off validateReferences, the library will no longer throw an exception at load time, but instead at runtime, which the library itself can handle instead.

#412
#622

@a-maurice a-maurice requested a review from cynthiajoan May 19, 2025 18:52
@a-maurice a-maurice merged commit bf88fac into master May 19, 2025
3 checks passed
@a-maurice a-maurice deleted the am-validate_refs branch May 19, 2025 18:54
@StephenHodgson
Copy link

This did not fix the problem.

Tried with Unity 6000.0.49f1 with only Android and Windows IL2CPP modules installed.

Assembly 'Packages/com.google.firebase.app/Firebase/Editor/Firebase.Editor.dll' will not be loaded due to errors:
Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

@a-maurice
Copy link
Collaborator Author

@StephenHodgson Odd. In your project, is "Validate References" still enabled for the Google.IOSResolver.dll? This change should make it off by default, but that error message seems like it is still on for you.

image

@StephenHodgson
Copy link

@a-maurice having to change properties inside of client projects is not a valid solution to this problem.

@a-maurice
Copy link
Collaborator Author

@StephenHodgson I'll admit, I'm confused here. My change is for the metadata of the DLL, which is in a versioned folder, so even on an update it should be replacing it, and getting the new metadata for it. The solution you had with using Define Constraints would similarly be an metadata file change, but had the issue of removing the 'iOS Resolver' settings from the Asset toolbar, which some developers do need because of cloud builds.

There is a larger fix, which would be to completely remove any direct dependency on the Unity iOS logic by using reflection, and I do have that seemingly working here, but I wanted more time to test it since it is a much more dangerous change: https://github.com/googlesamples/unity-jar-resolver/tree/am-xcode_dependency

But based on local testing, it seemed like setting validateReferences to off would cover most cases. I was even able to remove the iOS installation on our nightly test runners because of it, so I'm confused on why it doesn't seem to work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants