Yosemite hdiutil: create failed - error -5341 I could successfully use hdiutil for creating a dmg file for my program in Mountain Lion, but after upgrading to Yosemite (and after updating it to 10.10.1), when I execute

hdiutil create -srcfolder build/Thonny.app Thonny-0.2.5.dmg


I get following error:

hdiutil: create failed - error -5341


Verbose mode didn't reveal anything useful.

Folder build/Thonny.app contains a Python application.

Any idea what this error means and what to try next?

UPDATE: Looks like the number of files in my app affects the result. When I remove one of the files (doesn't matter which one), then the command is able to produce the result. Currently there are about 70 files and few folders under Thonny.app/Contents/MacOS
I had the same error -5341 and was able to work around it with the -megabytes option as suggested here.

hdiutil create -megabytes 130 Reassembly.dmg -srcfolder Reassembly


In this case the Reassembly directory is 107M and the resulting Reassembly.dmg is 97M. The -size 130m option did not work for me. My issue was intermittent - adding or removing one or two files would fix it or break it.