This content has been marked as final. Show 7 replies
When you receive an error like this from ELS, it indicates that the ELS store has been corrupted in some way. Your application should call reset() to clear the bad state.
Updating your application does not clear the ELS data. I'd need more details to try and determine what's going wrong.
Hi thanks for the reply.
I reset my ELS calling the reset() method, and yes it did remove the error, but not for long - it came back.
I guess I am writing something to the ELS from my application that it does not like?
It is strange, as, when I run the application it remembers / keeps the data in the ELS fine, even when I create a new AIR install it still remembers / keeps the data, no problem.
I have noticed that, when I changed the version number of the application and then create a new AIR application - it then forgets / looses this information.
What is even more strange, is that within my AIR application I am including a lib ("swc" file) from another project, and this "swc" is also writing to the ELS, but never forgets / looses its written data even when the application version is changed.
I may be wrong on this - but I assume the "swc" is writing to the same ELS as the application, as it is included in the application and exported within the application, so is essentially the same application so same ELS???
Any further thoughts?
Also, can I ask you, how secure is the EncryptedLocalStore? can the file it writes to be accessed easily and modified / deleted?
I don't think AIR is losing the ELS data. As you note, the SWC is accessing the same ELS and that's working, even when the version # changes.
ELS files can be easily deleted; it's not designed to protect against that. However, they cannot be easily read or modified.
Hi, thanks again for your fast reply.
is there any way to detect if an AIR app has been loaded for the first time (I think I remember scanning a related article re this, but I cant seem to find it again). E.g. if the ELS file is deleted is there any other way to check if the app has been loaded for the first time (I currently just write a var to the ELS that is checked against on further load ups).
Re my corruption problem / loosing data. I have tested this a bit more.
I am with you on this, and I don't think the ELS is loosing the data as you mentioned is can read the data written to it form the included swc file.
I just seems to crash on the data written from the app itself and I am going with the fact that this data is corrupted in some way.....
I havetraced all the values that are causing the crash during a debug session and they look good / as expected. it is really just when the application version ID is change that these (and only these) values being read are getting corrupted (somehow), However as mentioned, the values that were written form the included SWC file can be read fin with no problems whatsoever....
anybody got any suggestions?
Storing data somewhere is a good way to check for first launch, but I'd store that information elsewhere; not in ELS.
Are you using the stronglyBound parameter when calling setItem()? That binds the data to a specific version of your application, which would explain why it's not available after an update.
Where would you suggest to store the date to detect if it is a first launch....
maybe write a file deep in a systems file storage???
what do you mean by a strongly bound parameter??
When I call the setItem() I am calling it in a different class within the application, and tew values that I am writing to store are simple strings that are declared in the same class:
public var myString = new string(); etc......
It doesn't really matter where you write the file. File.applicationStorage is a handy location.
By "strongly bound", I was referring to the third parameter to the setItem() call.