IL2CPP crash with the simulator

I’ve compiled a project to the simulator using Unity 2022.3.11, Xcode 15.1 and polyspatial 0.4.3. When I run the build into the simulator, I get a crash in that line:


IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void RKRuntimeFuncs_GetPolySpatialNativeAPI_static_mCA2433F613CA9024ED9FD398154B1E40228DECCB (PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48* ___0_api, const RuntimeMethod* method)


typedef void (DEFAULT_CALL PInvokeFunc) (PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48_marshaled_pinvoke);

PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48_marshaled_pinvoke ____0_api_empty = {};

PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48_marshaled_pinvoke* ____0_api_marshaled = &____0_api_empty;


PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48 _____0_api_marshaled_unmarshaled_dereferenced;

memset((&_____0_api_marshaled_unmarshaled_dereferenced), 0, sizeof(_____0_api_marshaled_unmarshaled_dereferenced));

PolySpatialNativeAPI_tF855D128F93A12CA0DD9DC81AAD69043468D1A48_marshal_pinvoke_back(*____0_api_marshaled, _____0_api_marshaled_unmarshaled_dereferenced);

*___0_api = _____0_api_marshaled_unmarshaled_dereferenced;

Il2CppCodeGenWriteBarrier((void**)&((___0_api)->___SendClientCommand), (void*)NULL);



Anyway to fix this? We’ve this issue with other projects too.

I have not seen this. Do you have a small repro project you can share that we could look at?

Just to confirm, this is deploying a VR app on the simulator? If so, I think this error is caused by the presence of the PolySpatial packages - please try removing all PolySpatial packages and building the project again, see if that error pops up again.

Sorry for the inconvenience, we’re working on a fix which should be available with the next release.

I’m having this same issue with the exact same setup as above. Removing the polyspatial packages and related scripts fixed the build, but the app isn’t getting any input, not even for the Camera position. Is there a sample immersive (VR) app I can look at that does not use polyspatial?

Input in VR apps is currently limited at the moment, and it is something we aim to fix by next release. In the meantime, the PinchSpawn script in the MixedReality sample scene demonstrates using skeletal hand tracking data to detect when a pinch happens - for now at least, that’s the primary method for input in VR. We are working on a sample project that will demonstrate VR apps without PolySpatial.

1 Like