19 Replies Latest reply on Jan 15, 2015 12:10 AM by thx1138

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

    BurtJ Level 1

      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???

        • 1. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
          Flex harUI Adobe Employee

          Spark_rb.swc contains the components bundle

          1 person found this helpful
          • 2. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
            BurtJ Level 1

            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.

            • 3. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
              BurtJ Level 1

              Unfortunately, that did not fix the problem.  I am still getting the same error.

               

              What I did (after your suggestion) was:

               

              1) Open the project properties

              2) Go to "Flex Library Build Path"

              3) Change 'component set' to 'MX + Spark"  (was 'MX only')

              4) Press 'Add SWC" button

              5) Browse to 'C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\locale\en_US'

              6) Choose 'spark_rb.swc' file and press OK

              7) Verify that 'spark_rb.swc - C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\locale\en_US' is now in library list

              8) Press OK

              9) Repeat for both our internal library and current project (didn't work with just lib, so tried this too)

              10) Project->clean-all

               

              Ran and got the same error:

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

               

              Any other ideas of what might be missing, or do you spot an error in the way I interpreted your suggestion?

              • 4. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                BurtJ Level 1

                We are dead stuck here.  May have to revert to Flex3 if we can't get past this one.

                 

                Any further suggestions to get us off the hump?

                 

                (adding Spark_rb.swc did not resolve problem, as more detailed response above explains)

                • 5. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                  GordonSmith Level 4

                  That error is coming from installCompiledResourceBundle() in ResourceManagerImpl. Try setting a breakpoint and figure out why it is asking for en_US when you compiled for fr_FR. Are you using any modules compiled for en_US?

                   

                  - Gordon

                  1 person found this helpful
                  • 6. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                    BurtJ Level 1

                    Fair enough.  I didn't mention earlier that I had already done that debugging though. Breakpoint set at "public function installCompiledResourceBundles()", at line 255 specifically.

                     

                    1)  It shows that the code is first called with locale=en_US, where it successfully loads 10 bundles.  Not sure where that is coming from, but it works and is called before my parameter scanning code that resets the locale

                     

                    2) It is next called with locale=fr_FR (which our scanning code had set by this time).  Looks for 6 bundles, and finds them all.

                     

                    3) Next call has locale=en_US again.  It is looking for the following 6 bundles. It chokes on the first one.  I have not been able to find who is changing locale.

                     

                    bundleNames    Array (@addb779)   
                        [0]    "components"   
                        [1]    "core"   
                        [2]    "effects"   
                        [3]    "layout"   
                        [4]    "skins"   
                        [5]    "styles"   
                        length    6 

                     

                    Because this is an asynchronous thread, I don't have any useful stack to look at to tell me what really triggered that last call.  The stack shows:

                     

                    myname [Web Application]   
                        file:/C:/ConnectedProducts/common-web/myname/bin-debug/myname.html   
                            Main Thread (Suspended)   
                                mx.resources::ResourceManagerImpl/installCompiledResourceBundles   
                                mx.core::FlexModuleFactory/installCompiledResourceBundles [no source]   
                                mx.core::FlexModuleFactory/docFrameHandler [no source]   
                                mx.core::FlexModuleFactory/docFrameListener [no source]   
                        file:/C:/ConnectedProducts/common-web/myname/bin-debug/myname.html

                     

                    Is there any clue there that could help?  I have looked at it so many times I can almost quote it by heart, and might have developed blindfolds to a new way to interpret it...

                    • 7. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                      BurtJ Level 1

                      Oh yes, I forgot to answer your last question.

                       

                      Originally, we had "locale=en_US" as an additional compiler argument.  That is because the default for this should work in English.  Our parameter string on calling the web code can change that locale, and that portion works fine (in Flex 3 fully, and in Flex 4, I verified that the locale is also getting changed to fr_FR in this test).

                       

                      I removed that compiler argument, but the results are exactly the same.  The debug output described above is with the option off, though I remember getting exactly the same results when the option was on earlier.

                      • 8. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                        GordonSmith Level 4

                        Is this just a simple app, or an app with modules? If there are modules, do you know which one is causing the problem?

                         

                        I think processInfo() in ResourceManagerImpl will execute when each app or module SWF loads. The 'info' object passed in tells the runtime which compiledLocales and which compiledResourceBundleNames were compiled into that SWF, so that it can populate the ResourceManager with ResourceBundle instances. For example, if the compiledLocales is [ "en_US", "fr_FR" ] and the compiledResourceBundleNames is [ "core", "controls" ] then it is going to expect to be able to create four ResourceBundle instances from ResourceBundle subclasses such as en_US$core_properties etc. that should have been compiled into the SWF. Find out what these two info properties are for the app or module that is failing, and then maybe we'll have another clue.

                         

                        Gordon Smith

                        Adobe Flex SDK Team

                        • 9. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                          BurtJ Level 1

                          This is a "simple app."  That is, we use our own internal libraries, but everything is rolled into a single swf, and we do not use Flex modules.

                           

                          The ResourceManagerImpl is called 3 times.  The first is from the Flex initialization, which passes a single locale of en_US.  The second time is clearly for our resources, where it looks for a single locale of fr_FR (or "fr_FR,en_US" if I put both in the mxmlc line).  It then calls a third time, from a source I have not tracked down, again passing only a single locale of en_US.  That time it is asking for 6 bundles, 2 of which do not exist (see below).

                           

                          I believe the 'compiledLocale' entity you mention is what I enter in the mxmlc command (correct?).  We create a series of swf bundles, one per language using a command line of:

                           

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

                           

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

                           

                          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

                           

                          etc. We actually put each language swf on a different URL on our servers, since each language also has different data files driving them.  In the case of the French version, I am calling it with a parameter string that says to load the French flavor.

                           

                          As a test, I changed the French line to say:

                           

                          mxmlc -locale=fr_FR,en_US -source-path=. ^

                           

                          but I get exactly the same error.  The first call comes from the Flex init code, and is looking for the following en_US resources, all of which succeed:

                           

                          locales    Array (@2c84b629)   
                              [0]    "en_US"   
                              length    1   
                          bundleNames    Array (@2c84b661)   
                              [0]    "collections"   
                              [1]    "containers"   
                              [2]    "controls"   
                              [3]    "core"   
                              [4]    "effects"   
                              [5]    "logging"   
                              [6]    "messaging"   
                              [7]    "rpc"   
                              [8]    "skins"   
                              [9]    "styles"   
                              length    10 [0xa]

                           

                          The second asks for the following fr_FR resources, again all of which succeed. The following trace shows when the mxmlc command has "fr_FR,en_US".  In prior runs, this was identical except that there was no 'en_US' element in the locales array.

                           

                          locales    Array (@29f3e699)   
                              [0]    "fr_FR"   
                              [1]    "en_US"   
                              length    2   
                          bundleNames    Array (@29f3e6d1)   
                              [0]    "core"   
                              [1]    "effects"   
                              [2]    "resources"   
                              [3]    "skins"   
                              [4]    "styles"   
                              length    5  

                           

                           

                          The third call is the mystery one, and the one that has trouble.  It is again en_US, and asks for the following:

                           

                          locales    Array (@24514159)   
                              [0]    "en_US"   
                              length    1   
                          bundleNames    Array (@24514191)   
                              [0]    "components"   
                              [1]    "core"   
                              [2]    "effects"   
                              [3]    "layout"   
                              [4]    "skins"   
                              [5]    "styles"   
                              length    6

                           

                          Of these, both 'components' and 'layout' fail. The others are found properly.

                           

                          If I fudge the run so that it never asks for those two missing components, the program runs and much of it works, though there are missing elements on the screen.

                          • 10. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                            BurtJ Level 1

                            Did my last reply give any additional insights? Starting off another week, still stuck and considering just reverting to

                            Flex3 and forgetting the 4 upgrade...

                             


                            • 11. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                              GordonSmith Level 4

                              When I said "simple app" I really meant "single-SWF app", and this is a multi-SWF app. You're actually using resource modules, one for each langauge. (The alternative woudl be to compile the resources for all the langauges into your main application SWF.)

                               

                              We need to figure out where the third call is coming from. You must be somehow loading a third SWF that involves Spark components, because the problem bundles -- "components" and "layout" -- are only used by Spark components.

                               

                              Where in your code do you use import anything that starts with spark.foo or use a tag like <s:Whatever>?

                               

                              When you run in the Flash Builder debugger, does the Console pane have any information about which SWFs are loading?

                               

                              Gordon Smith

                              Adobe Flex SDK Team

                              • 12. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                GordonSmith Level 4

                                Since Flex 4 uses framework RSLs by default, the first or third SWF is probably a framework RSL. However, the framework RSLs don't include resources for the framework components; they're expected to be linked into the app or into your resource modules. It looks like when you build your resource modules you put only a single 'resources' bundle into them. Try changing the build script to specify all the bundles that your app uses, including framework bundles.

                                 

                                Gordon Smith

                                Adobe Flex SDK Team

                                • 13. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                  BurtJ Level 1

                                  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()[E:\dev\4.0.0\frameworks \projects\framework\src\mx\resources\ResourceManagerImpl.as:340]
                                      at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[E:\dev\4.0.0\framework s\projects\framework\src\mx\resources\ResourceManagerImpl.as:269]
                                      at mx.core::FlexModuleFactory/installCompiledResourceBundles()
                                      at mx.core::FlexModuleFactory/docFrameHandler()
                                      at mx.core::FlexModuleFactory/docFrameListener()

                                  • 14. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                    GordonSmith Level 4

                                    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

                                    • 15. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                      BurtJ Level 1

                                      SOLVED!  Well, sort of anyway.  Several mysteries still there, but enough for us to move forward. THANKS!

                                       

                                      One mystery --- I added the "-resource-bundle-list=C:\bundles_scout_fr.txt ^" line as you suggested.  It told me that I needed:

                                       

                                             bundles = core effects resources skins styles

                                       

                                      -  Note there is no 'components' or 'layout' there?  Added the components it asked for, and error still existed.

                                       

                                      -  Reverted the mxmlc locale parameter back to 'fr_FR' to see if that would change things. Nope.

                                       

                                      -  Added 'components' and 'layout' to the list of needed components. Nope. error still there.

                                       

                                      - Changed locale in mxmlc script to "fr_FR,en_US" -- and it worked!

                                       

                                      So, final result is I had to do the following changes:

                                       

                                      -  use locale of en_US in addition to whatever I really did want (ie, use "fr_FR,en_US" rather than just "fr_FR")

                                      - add all bundles, including 'components' and 'layout' even though those are not supposedly needed

                                      - add path for both the en_US and fr_FR framework paths (never tried just one, so don't know if that would have solved it alone)

                                       

                                      I will now tweak a bit more to see if I can reduce the necessary combiniations to a smaller set, but if I have it working, I at least can see my way forward.

                                       

                                      THANKS AGAIN!

                                       

                                      (BTW, I am available to bring the entire project down to San Jose office on a laptop if that would be useful...)

                                      • 16. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                        GordonSmith Level 4

                                        It sounds like there are still some mysteries, but I'm glad you can move forward now.

                                         

                                        The Flex team is the San Francisco office, but we don't do drop-in support. We're all busy working on the next release and do forum support in our spare time. Adobe also has a separate organization that provides paid support.

                                         

                                        If you find something that you think is a bug, please file it at http://bugs.adobe.com/flex. For example, if it turns out that any MX components are relying on the "components" or "layout" bundles, I think that's a bug because these bundles should only be required by Spark components.

                                         

                                        Gordon Smith

                                        Adobe Flex SDK Team

                                        • 17. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                          Wesley Petrowski Level 1

                                          I know this is an older thread, but I was having much the same troubles as you, so I thought I'd post my solution in case it helps you or anyone else who may find this thread.

                                           

                                          In my case, the problem was caused by compiled CSS stylesheets that had the wrong theme applied.  My main application was using the Halo theme, but my styles were being compiled separately using Ant, and did not specify a theme, which meant they got the default of Spark.  When I loaded the compiled styles swf at runtime, that is when I got the "Error: Could not find compiled resource bundle 'components' for locale 'en_US'" message.  I guess the styles swf was marked as needing the "components" resource bundle, since it was using the Spark theme.

                                           

                                          I was able to fix the problem by adding this to the mxmlc Ant task which compiled the styles:

                                           

                                                <compiler.theme dir="${FLEX_HOME}/frameworks/themes">

                                                  <include name="Halo/halo.swc"/>

                                                </compiler.theme>

                                          • 18. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                            BurtJ Level 1

                                            Thanks for the info!  We had pretty much given up and were just going to keep the Flex 3 projects in 3 as it was taking too much time to chase this down.

                                             

                                            With other projects on the front burner right now, it may be a week or two before I can go back and try this, but it sounds like it is exactly what I was looking for.

                                            • 19. Re: Error: Could not find compiled resource bundle 'components' for locale 'en_US'
                                              thx1138 Level 1

                                              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.