6

When loading OBJs into an MDLAsset using the MDLAsset(url:) initializer (to eventually get the model into SceneKit), the operation fails frequently and inconsistently on iOS14. This operation works fine for these same files on previous iOS versions. I've also observed the bug on iPadOS, although maybe less frequently. Not sure if it's relevant, but these OBJs are pulled from server and stored locally. But this bug is occurring after files are already downloaded. Sometimes the same file will fail multiple times before randomly working, and vice versa.

The console output seems to indicate a failure to communicate with ModelIO XPC service. I tried restarting my device, but the bug continues to occur. Console output:

connection to com.apple.ModelIO.AssetLoader was interrupted
AssetLoader.loadURL errorHandler: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.ModelIO.AssetLoader" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.ModelIO.AssetLoader}
Couldn’t communicate with a helper application.
connection to com.apple.ModelIO.AssetLoader was interrupted

Has anyone else run into this issue on iOS14? Alternatively, are there any workarounds anyone has tried in the meantime? As far as I know, loading an OBJ (that is downloaded from server) into SceneKit can only be done through ModelIO, without writing an OBJ parser myself.

Michael
  • 291
  • 2
  • 6
  • dealing with this issue as well :/ – Dave Lee Sep 23 '20 at 21:09
  • 2
    Seeing the same thing. I'm using a Bundle URL (not downloading over the network) so I don't think it has anything to do with your network connectivity. – johnboiles Sep 28 '20 at 20:25
  • 2
    It doesn't seem to work better if I use the main thread or other background threads of varying priorities. My current workaround is to: 1) minimize loading the same asset by caching in a `[URL: SCNGeometry]` dictionary when it loads and 2) retry up to 5 times to load the asset upon failure. – johnboiles Sep 28 '20 at 22:57
  • Yeah I've tested with local bundle OBJs and STLs too, on main and bg threads, and they still fail. Seemingly only really small files (like 100 vertices type small) are working consistently. When you're force-retrying consistently, do you usually see successful load within 5 times? – Michael Sep 29 '20 at 21:31
  • 1
    Having the same issue, fails on large meshes – blueether Oct 21 '20 at 18:20
  • To follow up here: I'm _not_ seeing consistent successful loads within 5 attempts. Sometimes the models never load. I've moved away from using `MDLAsset` for loading meshes. – johnboiles Dec 18 '20 at 19:58

2 Answers2

2

This seems to be fixed in 14.3.

0

2020-10-13 18:31:36.989282+0300 Studia3D Viewer[1452:348335] connection to com.apple.ModelIO.AssetLoader was interrupted

2020-10-13 18:31:36.989368+0300 Studia3D Viewer[1452:347676] AssetLoader.loadURL errorHandler: Error Domain=NSCocoaErrorDomain Code=4097 “connection to service on pid 0 named com.apple.ModelIO.AssetLoader” UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.ModelIO.AssetLoader}

2020-10-13 18:31:36.989404+0300 Studia3D Viewer[1452:348332] connection to com.apple.ModelIO.AssetLoader was interrupted

2020-10-13 18:31:36.997352+0300 Studia3D Viewer[1452:347676] Не удалось установить связь с приложением-помощником.

The same thing happens with local files

No solution yet