Skip to content

Fix Unity 6000.5 editor compile error in AppleBuildProfileEditor (CS0619) - #107

Open
oscarmakala wants to merge 1 commit into
apple:mainfrom
oscarmakala:fix/unity-6000-5-getassetpath
Open

Fix Unity 6000.5 editor compile error in AppleBuildProfileEditor (CS0619)#107
oscarmakala wants to merge 1 commit into
apple:mainfrom
oscarmakala:fix/unity-6000-5-getassetpath

Conversation

@oscarmakala

Copy link
Copy Markdown

Problem

Unity 6000.5 completes the InstanceID → EntityId migration and marks AssetDatabase.GetAssetPath(int instanceID) as error-level obsolete (CS0619, not suppressible). AppleBuildProfileEditor.cs calls it via objectReferenceValue.GetInstanceID() in two places (the default Info.plist and default entitlements pickers), so Apple.Core fails to compile in the editor on Unity 6000.5+, which blocks every plug-in that depends on it (GameKit, etc.).

error CS0619: 'AssetDatabase.GetAssetPath(int)' is obsolete

Fix

Use the AssetDatabase.GetAssetPath(UnityEngine.Object) overload directly with objectReferenceValue — it has existed since Unity 5, so the change is compatible with all Unity versions the plug-ins support; no version defines needed.

- string filePath = AssetDatabase.GetAssetPath(_serializedDefaultInfoPlist.objectReferenceValue.GetInstanceID());
+ string filePath = AssetDatabase.GetAssetPath(_serializedDefaultInfoPlist.objectReferenceValue);

(and the same for _serializedDefaultEntitlements.)

Testing

  • Compiles clean on Unity 6000.5.9f1 (editor recompile, zero errors) and behaves identically: the returned asset paths are unchanged.
  • In production use in a shipping project on 6000.5 (Apple.Core 3.2.0 + GameKit 4.0.1, rebuilt with this patch): editor, iOS device builds, and Game Center flows all working.

Both main and 27-beta currently carry the affected code.

🤖 Generated with Claude Code

…ompatibility

Unity 6000.5's InstanceID->EntityId migration makes GetInstanceID()-based
AssetDatabase.GetAssetPath(int) error-level obsolete (CS0619, not
suppressible), breaking editor compilation. The Object overload works on
all Unity versions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.

2 participants