Friday 18 December 2009

Updating Flex 4 SDK GeneratedResourceModule Error

I was updating to the latest Flex 4 SDK today which was a bit involved. For ages we’ve been using 10708 and have been unable to upgrade to a later version as Parsley didn’t work with it. There were some changes to the ModuleManager interface or something like that and Parsley’s Module management code needed to be updated.

Anyway, the parsley bug had been fixed and I was having problems with an SDK bug that I had reported a while ago and which has now been fixed. It seemed like a good time to update to the SDK but it did take a while:

  1. Download and set up new SDK version 13099
  2. Spend a while fixing all the compiler errors and adjusting code to work with new framework
  3. Run App
  4. Got Module errors due to Parsley (as in this thread)
  5. Check out latest parsley code from SVN
  6. build parsley swcs
  7. Run App
  8. Get module errors again
  9. build parsley swcs properly
  10. Run App
  11. Get a different error:

param 2 incompatible
  virt Object mx.core::FlexModuleFactory/callInContext()
  over *
GeneratedResourceModule7445881329779043571_mx_core_FlexModuleFactory/callInContext
()
VerifyError: Error #1053: Illegal override of
GeneratedResourceModule7445881329779043571_mx_core_FlexModuleFactory in
GeneratedResourceModule7445881329779043571_mx_core_FlexModuleFactory.

     at global$init()

Initially I incorrectly blamed this on Parsley again. I did some googling and couldn’t find much about GeneratedResourceModule apart from this. That got me thinking about resource bundles. It turns out that all I needed to do was to re-build my resource bundles with the new SDK so they were compiled with the new Module interface. It was a simple step that I should have done straight away but I had forgotten.

Hopefully this post will save someone else a bit of time if they have the problem as well.