Copy link to clipboard
Copied
Some users of a desktop app I publish often write to me saying they're getting a "2038" Error when they try to save a file or export a png of that file.
#2038 is tough to diagnose, though, as it's just an I/O Error without much detail. Has anybody else publishing to desktop had some of your users report this error?
When I export, for example, I'm just building a file by using the File object, like so...
exportFile = File.documentsDirectory.resolvePath(fname + ".pdf");
And then doing a browse for save...
exportFile.browseForSave("Export to pdf");
It seems like there's little room for something to go wrong, but I get this bug report quite often.
Thanks for any thoughts or suggestions.
- Daniel McQuillen
SimpleDiagrams.com
Copy link to clipboard
Copied
Hi Daniel,
I am unable to reproduce the issue at my end. Can you please provide us with sample project reproducing the issue? You can mail the project at nitanwar[@]adobe.com.
Copy link to clipboard
Copied
Hi Nitanwar,
I wish I could reproduce exactly, but that's what mysterious about it. Many users have reported this issue to me over time, often saying they can't save their SimpleDiagrams document (even to their desktop) or they can't export a pdf version of their document (i.e. my application generates a pdf and tries to save it where then did a browse-to-save).
So are there some known conditions where an AIR desktop app will be denied by the OS when trying to save a file? Have others experienced this?
Very strange...
Thanks,
Daniel
Copy link to clipboard
Copied
HI Daniel,
I was able to save the SimpleDiagrams document on my desktop both on Mac and Windows.
Without the exact reproducible steps from your side it would be difficult for us to find the real cause of this issue .
Can you please ask your users the scenarios/steps which reproduce the issue.
Also please provide the OS information and Adobe AIR version for which you are facing this error.
Thanks
Copy link to clipboard
Copied
Hi Nitanwar,
Thanks for your help. This is a really pernicious bug. It seems to mostly occur to OSX users, and only a subset. It happens whenever they try to do a save operation (either of their document or of an 'exported' png or pdf).
The trace is unfortunately not very helpful:
Error: Error #2038
at com.simplediagrams.business::DiagramDelegate/exportDiagram()
at com.simplediagrams.business::FileManager/saveDiagramToFile()
at com.simplediagrams.business::FileManager/onSaveFileAsSelected()
In the exportDiagram() method, I'm using FZip (https://github.com/claus/fzip) to write out my file...
var libXml:XML = libDelegate.writeLibrary(library);
fZip.addFileFromString("library.xml", libXml, "utf-8", false);
var s:FileStream = new FileStream();
s.open(resultFile, FileMode.WRITE);
fZip.serialize(s);
s.close();
fZip.close();
Do you have any thoughts on how to resolve the bug, either by including extra log information or going about the operation in a different way?
Thanks for your help.
Daniel
Copy link to clipboard
Copied
More than a year later but I continually fight this. It appears like the file doesn't really close or something. If they use a different filename or delete the old file, it seems to work fine.