EncryptedLocalStore general internal error

So I’m developing an AIR app, and experimenting with the EncryptedLocalStore features of AIR. I got to a point where I thought my code was solid, but I wanted to erase all the mistakes I’d created in my keychain. So, I went into Keychain Access, and deleted the keychain file that looked like it was associated with my app (wish I had the keychain file name, but it’s gone). When I restarted my app, and it went to write to the keychain, I get this error:

1
2
3
Error: general internal error
at flash.data::EncryptedLocalStore$/processErrorCode()
at flash.data::EncryptedLocalStore$/setItem()

Even more strange, it only threw this error with the app launched via Flex Builder. If I took the AIR file and installed and launched the application, there was no error.

I tried everything I could think of to start over, from recreating my project to reinstalling Flex Builder. Luckily, NoboG on the Adobe support forums pointed me in the right direction. All I had to do was delete the related files in ~/Library/Application Support/Adobe/AIR/ELS/

Now Flex Builder works again on my laptop, and I’m well pleased.

Do not use a collection of flash.filesystem.File objects as a dataprovider

I’m sure someone will fill in the technical details in the comments (hint hint, AIR experts), but here’s what I ran into.

I’m building an image upload system, and I’m allowing people to drag & drop images onto the app for upload. When they drop the images, I put all the File objects into an ArrayCollection, and then I rendered previews in a giant TileList driven off that ArrayCollection. Now, I figured that might be a little intensive, but it was taking 5-10 seconds to scroll down one row. I figured that it was just beyond AIR’s capabilities to render these jpg files (they are 2-10MB each) that fast, even off the local file system. So, I switched my TileList to a List, but had the same problem, even though I was just displaying File.name.

When I had that result, I figured there must be something about the flash.filesystem.File object that was causing the problem. So, I created a shadow ArrayCollection that I filled with a custom object, FileLight:

1
2
3
4
5
6
7
8
9
10
11
12
package org.iotashan.file {
    public class FileLight {
        public var name:String;
        public var extension:String;
        public var nativePath:String;
    }
    public function FileLight(name:String,extension:String,nativePath:String) {
        this.name = name;
        this.extension = extension;
        this.nativePath = nativePath;
    }
}

When I drove the TileList off of the ArrayCollection filled with FileLight objects, performance came back to acceptable levels. Feel free to use that code however you want.