1 Reply Latest reply on Jun 16, 2014 3:10 PM by luca mezzalira

    Writing to files fails on release builds.

    irongamer

      Hello,

       

      I've been attempting to save the state of my game to disk.  I've tried using both SharedObject and just writing my own file using File.applicationStorageDirectory.  Both of these work fine with a debug build.  However, both fail to write files if I use release build.  What gives?  Do I have to have a certificate from Microsoft or Android to save files from a release build AIR application now?

       

      I'm using Windows 8.1, Android 4.4.2, AIR SDK 13, Flash Builder 4.7, .  Both Windows and Android will save files from a debug build.  Both will not save files from a release build.  I am using a self signed digital signature, it has been around a while.  Do I need to generate a new one?  Or is there a different problem?

       

      Update

      I created a fresh Actionscript Desktop (Adobe AIR) project, imported the previous projects code, and got it running.  Same problem.  I tried native installer and application with captive runtime.  Release builds cannot write to the applicationStorageDirectory or the documents directory.

       

      Update 2

      So, the issue appears to be a serialization problem with the builtin JSON.  JSON.stringify is throwing an error in the release build, but not in the debug build.  Admittatly I was throwing a fairly complex object at it, however the behavior change between the builds seems poor on adobe's part.  To get around this I downloaded the ac3corelib, gutted, and refactored the object serialization component to fit my needs.  The complex object is handled in a more simple manner and it works.  Disappointed in adobe's serialization, but from what I see around the net that is pretty common.