Skip to content

Fix Unity 6.5 build error in AppleBuildProfileEditor (CS0619) - #111

Closed
mateuszjanczewski wants to merge 1 commit into
apple:mainfrom
mateuszjanczewski:fix/unity-6-5-getassetpath-entityid
Closed

mateuszjanczewski wants to merge 1 commit into
apple:mainfrom
mateuszjanczewski:fix/unity-6-5-getassetpath-entityid

Conversation

@mateuszjanczewski

Copy link
Copy Markdown

Problem

Apple.Core does not compile on Unity 6.5 (6000.5).

Unity 6.5 changes Object.GetInstanceID() to return EntityId, and makes the
EntityId → int implicit conversion obsolete as an error rather than a warning:

error CS0619: 'EntityId.implicit operator int(EntityId)' is obsolete:
'Use EntityId explicitly instead of int'

AppleBuildProfileEditor.cs calls AssetDatabase.GetAssetPath(int) in two places, so
the editor assembly fails to build and python3 build.py cannot produce the plug-in
packages on 6.5.

Both sites are still present on main as of 4b2455f:

  • plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuildProfileEditor.cs:183
  • plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Editor/AppleBuildProfileEditor.cs:235

Fix

Both call sites already hold the Object itself, so they can use the
AssetDatabase.GetAssetPath(Object) overload directly:

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

This is equivalent — GetAssetPath(int) resolved the instance id back to the same
object — and it is not conditional on 6.5: the Object overload has existed for a
long time, so this compiles on older Unity versions too and needs no version guard.

Testing

Applied against Unity 6000.5.9f1 in a project that consumes
com.apple.unityplugin.core and com.apple.unityplugin.gamekit via build.py
packages. With the change, Apple.Core compiles, build.py produces the packages,
and the consuming project builds for iOS and macOS. Without it, the editor assembly
fails to compile on 6.5.

The change is confined to two editor-only inspector call sites and does not touch
runtime plug-in behaviour.

🤖 Generated with Claude Code

Unity 6.5 (6000.5) makes the EntityId -> int conversion obsolete as an
ERROR (CS0619), not a warning. Object.GetInstanceID() now returns EntityId,
so AssetDatabase.GetAssetPath(int) no longer compiles:

  error CS0619: 'EntityId.implicit operator int(EntityId)' is obsolete:
  'Use EntityId explicitly instead of int'

Both call sites already hold the Object itself, so they can use the
AssetDatabase.GetAssetPath(Object) overload directly. That is equivalent -
GetAssetPath(int) resolved the instance id back to the same object - and it
compiles on every Unity version that has the Object overload, so this is
not conditional on 6.5.

Without this, Apple.Core fails to compile on Unity 6.5 and the plug-in
packages cannot be built.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ryzngard

Copy link
Copy Markdown
Collaborator

Thank you for contributing. This has been resolved with #107

@ryzngard ryzngard closed this Sep 10, 2026
ryzngard added a commit that referenced this pull request Sep 16, 2026
…111)

The native Transaction_BeginRefund(WithId) cdecls invoke their success
callback as SuccessTaskRawPtrCallback, passing a heap-allocated
Transaction.RefundRequestStatus via getRawPointer(). The managed side
declared the callback as SuccessTaskCallback<int> and cast the value
straight to the enum, so it read the low 32 bits of a 64-bit pointer as
the status -- producing a garbage RefundRequestStatus -- and never freed
the native allocation.
ryzngard added a commit that referenced this pull request Sep 16, 2026
Audit each plug-in against its last release tag and, for everything that
landed since, bump the version and write a CHANGELOG entry. Point every
dependent at Apple.Core 3.3.0.

| Plug-in           | Old -> New      |
|-------------------|-----------------|
| Accessibility     | 1.1.5 -> 1.2.0  |
| BackgroundAssets  | 1.0.0           |
| Core              | 3.3.0           |
| CoreHaptics       | 1.3.2           |
| GameController    | 1.2.4 -> 1.2.5  |
| GameKit           | 4.0.1 -> 4.1.0  |
| PHASE             | 1.2.8           |
| SpatialController | 1.0.6           |
| StoreKit          | 1.0.0           |

Accessibility goes to 1.2.0 rather than the 1.1.5 set by #113, since the
Audio Descriptions API is a new feature.

Gaps this fills beyond the version bumps:

- Apple.StoreKit and Apple.BackgroundAssets shipped in the 27.0 beta
  without a CHANGELOG.md. Both now have one, each a single initial
  release entry. StoreKit stays at 1.0.0: the API added in #112 and the
  Transaction.BeginRefundRequest fix in #111 both landed between the beta
  and now, so they are part of the initial release rather than a delta
  on top of it.
- "Prepare for Xcode 27" raised the native deployment targets to iOS and
  tvOS 15.0 and macOS 12.0 and went undocumented. Now called out in every
  affected plug-in. This matches the floor the README already documented,
  so it is not a change in supported OS versions.
- Every Native/*.xcconfig CURRENT_PROJECT_VERSION had drifted from its
  package.json, some by several releases (CoreHaptics read 1.2.4 against
  a 1.3.1 package). That value feeds MARKETING_VERSION and the generated
  Info.plist, so the binaries would have shipped mislabeled. All are now
  synced.
- SpatialController 1.0.5 listed only stylus support, but also carried a
  native memory leak fix and the PolySpatial/Visual Scripting dependency
  removal. 1.0.5 was never tagged publicly, so the entry is filled out.
- Newly documented: the GKLocalPlayer_RegisterLocalPlayerListener removal
  (IL2CPP link failure against the iOS 27 SDK), Apple.Core's native
  library warning-to-error escalation and dead shell-command removal, and
  the PHASEWrapper update.

External contributions credited in the changelogs:
- CoreHaptics AssetPickerDrawer null fix - @ilterbilguven (#47)
- GameController GCController allocation fix - @HypGamesOrlando (#35)

Co-authored-by: Claude Opus 5 (1M context) <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