Skip to content
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

Fix OnApplicationStart DllNotFoundException in Unity Editor for Windows #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pomdap
Copy link

@Pomdap Pomdap commented Oct 14, 2024

Issue

When starting the Unity Editor on Windows while using AppleUnityPlugins, we get the following error:

DllNotFoundException: AppleCoreNativeMac assembly:<unknown assembly> type:<unknown type> member:(null)
Apple.Core.Availability.OnApplicationStart () (at ./Packages/com.apple.unityplugin.core/Runtime/Availability.cs:13)

Expected behaviour

We should not get any Error in the Editor.

Fix

Add ifdef around the Dll imported methods.

jared-marsau added a commit that referenced this pull request Jan 7, 2025
* Microsoft's Unity linter asked me to fix this.

* Reorganizing some calls and order of operations for two reasons:
- Compatibility with Unity's batchmode
- Avoid interactions with the Asset Database while it's in an undefined state - defer to `OnPostprocessAllAssets`

* Unity project version bump.

* I feel like this is pretty close to what it needs to be. I'll test it out tomorrow - but currently it works in just the local Apple.Core Unity project. I'll go through various builds in both Editor and Batch mode builds to check.

* Addressing review feedback and cleaning up some comment formatting here and there.

* No gelpers allowed.

* Version bump.

* Tested with the following and works:
- Built all plug-ins
- Created new project and imported Apple.Core and the GameKit plug-ins
- Built in the Editor for iPad, generated Xcode project works as expected
- Built on command line with batch mode, generated Xcode project works as expected.

---------

Co-authored-by: Adam Szofran <aszofran@apple.com>
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.

1 participant