Xcode crash when importing Collada file

Drag a .dae file into Xcode project. Select the file in the project navigator. Xcode crashes.

Replies

Does it happen just with a particular file or with ALL .dae files you try ?

What version of Xcode and Mac OS are you using? I am running XCode 8 (beta) on 10.11.5, 10.11.6, and 10.12 (beta) and am not able to reproduce this issue with my own .dae files. Curious if there is something specific about your dae files, version of Xcode, etc... It would definitely be good to report this and attach the crash logs along with at least one dae file that is giving you problems if you haven't done so already.

Any .dae file, for example hero.dae from WWDC SceneKit slides.

I am using Xcode 8 (beta) and 10.12 (beta). It happens with any .dae file, for example hero.dae from WWDC SceneKit slides.

Actually, after more testing, it crashes when I deselect the .dae file in the project navigator, and the SceneKit editor disappears. 100% repeatable.

Here is the top of the stack trace:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib         0x00007fffd1953dda __pthread_kill + 10
1   libsystem_pthread.dylib       0x00007fffd1a3e7a7 pthread_kill + 90
2   libsystem_c.dylib             0x00007fffd18b94c8 abort + 129
3   com.apple.dt.IDEKit           0x000000010eaa8179 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 1466
4   com.apple.dt.IDEKit           0x000000010eaa880d -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 1204
5   com.apple.dt.DVTFoundation     0x000000010d24a9b8 _DVTAssertionHandler + 541
6   com.apple.dt.DVTFoundation     0x000000010d24abd2 _DVTAssertionFailureHandler + 411
7   com.apple.dt.DVTFoundation     0x000000010d08472c _DVTInvalidation_HardAssertDidInvalidateDeallocSuper + 721
8   com.apple.dt.IDE.IDESceneKitEditor 0x000000012367f9b1 0x12367a000 + 22961
9   com.apple.dt.IDEKit           0x000000010eb258a7 -[IDEEditorDocument _editorDocumentWillClose] + 72
10  com.apple.dt.IDEKit           0x000000010eb27cfd -[IDEEditorDocument close] + 1316

Also seeing Xcode 8 (beta4) crashing when previewing DAE files which are fine in Xcode 7.3.1 - and which happily preview from the Finder/Quickview.


I wish I had retained a copy of beta 3. It was a bit less fragile.

Update.


The crashing on DAE import problem went away in XCode 8 (beta5)


The crashing on DAE import problem came back in XCode 8 (beta6) - I suggest keeping beta 5 for a while.

I had same problem in Xcode 8.2.1 ..

Although this answer may be delayed as I had this problem with Xcode 13.2 but my reason was My DAE file is large that even my M1 Latest Macbook cannot handle it on Xcode but I found the solution by using terminal command scntool

xcrun scntool --convert INPUT.dae --format scn --output OUT.scn --asset-catalog-path .

here is a complete answer for this problem

Convert Large DAE to SCN Using Terminal

You need: Xcode To Be Installed On Your Mac

Now Open Terminal

1- Set The scntool to be Called From Anywhere 

export PATH="/Applications/Xcode.app/Contents/Developer/usr/bin"

Note : you can ignore last line is you add xcrun before scntool

Example 

 xcrun scntool --convert INPUT.dae --format scn --output OUT.scn --asset-catalog-path .

2- Change Your Directory To where The DAE and The Resources are My Folder named Export

cd THE_LOCATION_OF_YOUR_DAE_FILE

Example

cd /Users/YOURHOME/Desktop/Export

3- Use scntool to convert it like that (INPUT and OUTPUT is names of the file)

The dot at the end of the command line is very important it means you will set resources to same location 

	scntool --convert INPUT.dae --format scn --output OUT.scn --asset-catalog-path .

Or if you do not set scntool default path

 	xcrun scntool --convert INPUT.dae --format scn --output OUT.scn --asset-catalog-path .

Example:

scntool --convert ISS.dae --format scn --output ISS.scn --asset-catalog-path .

If you don’t set the —asset-catalog-path . You will have no materials 

By comparing 2 Output files, one with correct conversion and the other without 

You will notice a missing line “path”, this line “path”, tells the SCN file to search the materials in the correct location 

Mistaken Out.scn

	},

	{	"$class" = :false;

		NS.keys = ( :false );

		NS.objects = ( :false );

	},

	"AMS02Coil.png",

	{	"$classes" = ( "NSMutableDictionary", "NSDictionary", "NSObject" );

		"$classname" = "NSMutableDictionary";

	},

Correct Out.scn File

	},

	{	"$class" = :false;

		NS.keys = ( :false );

		NS.objects = ( :false );

	},

	"path",

	"AMS02Coil.png",

	{	"$classes" = ( "NSMutableDictionary", "NSDictionary", "NSObject" );

		"$classname" = "NSMutableDictionary";

	},

Here is a List Of scntool Command Options (I Got It From This Location 

https://gist.github.com/matux/4a30c4b4b29d636fe6847b6a3234bc4f)

$ xcrun scntool --verbose

| Current SceneKit version is 4.560000

| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]

--convert: File to convert. Formats found to be supported: com.apple.scenekit.scene (scn), com.apple.scenekit.scene.zip (scnz), com.apple.scenekit.particlesystem (.scnp), org.khronos.collada.digital-asset-exchange (.dae), c3d, bplist

--format: Format to convert to. Formats found to be supported: scn, c3d, dae.

--output: Destination path and filename.

-c (--compress)

-d (--decompress)

--uncompress

--copy

--target-platform=

--target-version=

--target-build-dir=

--asset-catalog-path

--resources-path-prefix

--resources-folder-path=

--force-y-up: Some documents use different up axis. When enabled, objects in a scene are converted to the Y-up orientation.

--force-interleaved: Because most geometries use more than one geometry source and the GPU typically uses data from multiple sources together, you can achieve better rendering performance for custom geometries by interleaving the vertex data for multiple semantics in the same array.

--prefer-compressed-textures: Use this option to prefer KTX, ASTC and PVRTC to other file formats. When enabled, if an image is referenced by a scene and exists within the asset catalog with the same name and the .astc or .pvrtc file extension, the compressed version will be used by SceneKit.

--verbose: Always use verbose to get pretty error messages. With --verbose: scntool: error: No file at path /path/to/model/file.scn Same error, without --verbose: