Skip to main content
MindStormPhoto
Known Participant
November 29, 2010
Answered

Error: Could not find compiled resource bundle 'components' for locale 'en_US'

  • November 29, 2010
  • 2 replies
  • 14826 views

We are porting a fairly large body of Flex3 code developed under FlexBuilder 3 to Flex4 under FlashBuilder 4.  Most of the conversion appears to be working fine, with one exception.  When I launch the Flex4 version, all my data interchanges with the server works.  Just as it is about to show the UI, the following error occurs:

     Error: Could not find compiled resource bundle 'components' for locale 'en_US'

I am actually using a locale of fr_FR, but I assume it couldn't find that, reverted to en_US, failed again and then barfed.  If I look in

     ~Adobe Flash Builder 4\sdks\4.0.0\frameworks\locale\fr_FR

I see a lot of swc files, and of course no 'components.swc'.  I believe the problem is that our Flex3 code is using mx components, and the compatibility mode is not properly handling it for some reason.  I think this is mostly from our in-house UI library.  The properties for that library (and for my main app I am testing now) have:

     - Use default SDK (currently "Flex 4.0")

     - Use Flex 3 compability mode

     - Use minimum version (Flash Player) required by the Flex SDK

     - Enable strict type checking

     - Enable warnings

I also tried putting the compatibility flag in the mxmlc compile line, with no change in behavior.  This project is built by the following script:

ruby scripts/concat_properties.rb -o resources.properties ^
     src/main/flex/locale/fr_common/res_myname_fr_common.properties ^
     src/main/flex/locale/fr_common/scout/res_myname_scout_fr_common.properties ^
     src/main/flex/locale/fr_fr/res_myname_fr_fr.properties ^
     ../../scout/common/src/locale/fr_common/mypals/resources.properties
mxmlc -locale=fr_FR -source-path=. ^
     -compatibility-version=3.0.0. ^
     -static-rsls=true ^
     -include-resource-bundles=resources ^
     -output src/main/resources/bundles/mypals/fr_fr_resources.swf
copy src\main\resources\bundles\mypals\fr_fr_resources.swf ^
     bin-debug\bundles\mypals

What have I missed???

    This topic has been closed for replies.
    Correct answer GordonSmith

    You have two posts. I will try to answer each completely.  Second one first. You say I should change my build to include the framework resources.  I am afraid I am not sure which and what to do there.  We combine all our properties file into one large one, then use the following build line:

    mxmlc -locale=fr_FR,en_US -source-path=. ^
         -compatibility-version=3.0.0. ^
         -static-rsls=true ^
         -include-resource-bundles=resources ^
         -output src/main/resources/bundles/mypals/fr_fr_resources.swf

    I am assuming you are telling me to change the "-include-resource-bundles" line, but what to add?  The "sdks\4.0.0\frameworks\locale\en_US" holds 13 swf files.  I tried adding that entire folder (along with the fr_FR folder) to the project library path (in the project properties dialog), but that made no change.  I also tried reverting the library path tab back to "MX Only" instead of "MX + Spark", but again no change.

    ====================
    For your first message, I did a search for 'spark' in the entire project.  It only existed on 3 lines, each at the start of css files:

        @namespace s "library://ns.adobe.com/flex/spark";

    I had put those in based on reading needed changes to naming in CSS.  Since I was not actually using any spark ('s') components yet, I removed these lines.  The entire project now does not have the word 'spark' anywhere in it. No change in behavior (as I expected).

    I did a search for "s:" throughout the project.  That does exist in probably 100 places, but all are legitimate. Things like (xmlns:mx="http://www.adobe.com/2006/mxml") or variable names ("var matches:Object").  No reference to any s: object.  (While on the topic, why does FlashBuilder still not have a "whole word" box to limit searches??).

    Note that when I first reported this problem, the compiler was set to ONLY support fr_FR.  In fighting this, I changed it to "en_US,fr_FR" hoping that would tell the compiler to load whatever en_US items it was looking for.  We really do not want any English support in this version. (We do have another SWF created with only support for en_US, and another for en_UK, etc.  Each language is a separate node on our server, so there is no need to mix & match at runtime)

    The console shows a lot of swf loads that I do not understand...

    The console output shows (my comments after ==> indicator)

    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\myname.swf - 2,229,992 bytes after decompression
                 ==> our locale is set here, after the above load and before the next line
    Look for name file at: ./data/fr_fr/names.csv
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\myname.swf - 21,200 bytes after decompression
    Loaded 2278 names.       ==> indicates successful load of data retrieved from server
    Loaded 154 bad words     ==> our second data set has been retrieved and loaded
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 58,777 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 322,606 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\bundles\mypals\fr_fr_resources.swf - 595,025 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 202,168 bytes after decompression

        ==> not sure what this next warning means.  I'm guessing I will later have to research it and return to 'secure' comm with server, but I'm ignoring for now
    Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml.  The 'secure' attribute is only permitted in HTTPS and socket policy files.  See http://www.adobe.com/go/strict_policy_files for details.

    Resource bundle loaded for locale fr_fr  ==> at this point, we appear to have our French assets loaded successfully
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 202,168 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 1,303,976 bytes after decompression

    [Unload SWF] C:\ConnectedProducts\common-web\myname\bin-debug\myname.swf  ==> some runs see this, but others do not. I expect it is a timing issue of whether it is reached or not before the crash

    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 794,898 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 194,635 bytes after decompression
    [SWF] C:\ConnectedProducts\common-web\myname\bin-debug\styles\mypals_style.swf - 261,589 bytes after decompression

    ==> everything looks fine up to here.  This is then when the third call to installCompiledResourceBundles occurs

    Error: Could not find compiled resource bundle 'components' for locale 'en_US'.
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()
        at mx.core::FlexModuleFactory/installCompiledResourceBundles()
        at mx.core::FlexModuleFactory/docFrameHandler()
        at mx.core::FlexModuleFactory/docFrameListener()


    When you compile your application SWF, use the -resource-bundle-list option by specifying something like -resource-bundle-list=C:\bundles.txt. The compiler should write into this file the names of all the resource bundles that your app uses.

    Then add all of these bundle names to the -include-resource-bundles option when you compile your resource modules, so that your resource modules have not just your own resources but also the resources needed by the framework classes that your app uses. Use a comma-separated list such as -include-resource-bundles=resources,core,controls,containers. Specify additional source paths so that it can find the .properties files for these bundles, which are located in directories such as frameworks/projects/framework/bundles/en_US, frameworks/projects/mx/bundles/en_US, frameworks/projects/spark/bundles/en_US. You can use {locale} in place of the actual locale, as in frameworks/projects/framework/bundles/{locale}.

    If this doesn't fix the problem, I'm afraid that I'm out of ideas.

    Gordon Smith

    Adobe Flex SDK Team

    2 replies

    Inspiring
    January 15, 2015

    In my case it occurred when I made one of my project libraries linked externally. The FC library was using the Flex 4.6 SDK by default and I switched my main project to use the wonderful Apache Flex 4.14. This was not causing any issues as the library was added as a project (not a swc). When I made the link external it caused that's when the error occurred. I changed the link back to "Merge into code" and the error went away. If I made them use the same SDK I'm guessing that it would be fine to use external link type.

    Adobe Employee
    November 29, 2010

    Spark_rb.swc contains the components bundle

    MindStormPhoto
    Known Participant
    November 30, 2010

    Thanks!

    Unfortuantely I just got pulled back to an urgent Flex3 issue, and I can't seem to get Flex3 and Flash4 working concurrently on my system.  I expect to be back to this tomorrow, and will then be able to confirm that this is the right answer -- sounds logical anyway, so I have high hopes.