FLEX 4.6 could not find resource bundle 'components' for locale 'en_US'

3046
9
Jump to solution
02-11-2013 10:42 AM
CoreySmolik1
New Contributor II
I've seen this issue on some of the Flex forums at Adobe and Esri, but have not been able to reach a solution.

I started with custom written widgets designed to work in ArcGIS 1.x API for Flex and have migrated them to work on the ArcGIS 3.1 API for Flex.  There is one main widget, a modified query widget (which queries a map service for specific feature types) and 2 others that serve as popups, makings graphs from SQL data returned as an xml document, facilitated by a web service.  I know it might be a bit verbose, but I am trying to paint a clear picture of what I have done so far.

I have successfully gotten the widgets to work in the FlashBuilder 4.6 environment using the out-of-the-box ArcGIS API for Flex 3.1 , but my goal is to take the widgets from that environment into an existing flexviewer website, which was modified by another user using Application Builder.  (A big thanks to the article by Robert Scheitlin, Bjorn Svensson, and Derek Law.  Just seeing it work in my development environment made my weekend a couple of weekends ago.)


I've added the SWF's to a subfolder in our staging website (a copy of our live website) and set up the config.xml and widget config xml appropriately.  The primary query widget displays, but will not display the query results.  I get an error message with the following error:

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()

There are a host of other errors, but I assume that they are results of asynchronous function calls continuing after the first is stymied.

I have used a variety of compiler options from the standard choices and checkboxes.  for example, I am using the default Flex SDK (4.6 for my version), the minimum version of Flash Player required by the Flex SDK.  I have all of the compiler options checked (Flash Text Engine in MX components, copy non-embedded files to output folder, etc...)

I am compiling with the following additional compiler arguments:
-locale en_US -source-path=locale/{locale} -keep-all-type-selectors=true
-resource-bundle-list=c:\bundles.txt^  (just to get a list of resource bundles to include)    
-include-resource-bundles=ESRIMessages,SharedResources,charts,collections,components,containers,controls,core,effects,formatters,layout,logging,messaging,osmf,rpc,skins,sparkEffects,styles,textLayout,utils,validators

If anyone can help, I would greatly appreciate it.

Thank you
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Corey,
   The 3.0 and 3.1 thing is likely the issue. It is not normally a good idea to mix releases.

View solution in original post

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Corey,

   I am not sure why you have all those extra compiler arguments but when I build a widget for deployment I use these arguments to avoid the swf only being set for a specific locale:
i.e NO Locale
-locale -source-path=locale/{locale} -keep-all-type-selectors=true
0 Kudos
CoreySmolik1
New Contributor II
Thank you for your response.  I got the "could not resolve "ViewerStrings" error when I compiled with those arguments.  I passed my source on to ESRI, where it is currently picking it apart.  They think that some of the code that I "borrowed" from the older form is affecting the compiler, though if it compiles for a debug, I can't imagine why.  I'll post the results.

Something that I had not considered is that our site is built using 3.0 API, but I am developing in 3.1.  I'll try and get a 3.0 swc and build a project using that.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Corey,
   The 3.0 and 3.1 thing is likely the issue. It is not normally a good idea to mix releases.
0 Kudos
HeatherGonzago
Esri Contributor
Using 3.0 - it was required to compile the custom widget with the Flex compiler arguments -locale= , indicating an empty locale. This is no longer required with version 3.1.

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Packaging_custom_widgets_for_ap...


In 3.1 this changed, take a look at

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/What_s_new_in_the_3_1_ArcGIS_Vi...

where it mentions - "The line [ResourceBundle("ViewerStrings")] was removed from the source code's BaseWidget class. It is no longer necessary to compile custom widgets using the Flex Compiler argument for an empty locale, -locale= "
0 Kudos
CoreySmolik1
New Contributor II
Thank you for the feedback.  

In the end, it was an issue of mixing the versions.  I built a site in Flex 3.1 using application builder and added the widget with "Manage Custom Widgets".  The tool is functioning exactly as it was intended to do.

A point of interest is that while the tool is working, I am still getting the components error, but only when the site debug is on.  I've been doing my homework on how the code is using the resource bundles, though, and expect I'll have it sorted out soon.


Robert (and crew), I'll say thanks again for the document on widget migration that you put out.  I've done some coding, but had no experience in working in the Flex environment when I was asked to take a shot at migrating an old 1.x widget into the current environment.  It was the single best resource that I had in the process.     

Corey
0 Kudos
JoeTack
New Contributor III
Thanks for the info on changing the Additional Compiler arguments to no locale.  I just downloaded the Flex Viewer 3.6 and once it was imported to a new project, it yielded over 100 errors stating "Could not find resource bundle 'components' for locale 'en_US'".  Not sure what the underlying error is, but at least I can run the viewer.
0 Kudos
CoreySmolik1
New Contributor II
Hi Joe,

  I never did fully resolve it in Flex, mainly because I was able to get the site to display, and it only notifies you when debugging mode is on.  In another development environment, I would say that an en_US resources folder would have to be added to the project and built in to the project.  Since I am not deploying the site internationally, I left it alone.
  The problem that was preventing the site from running appeared tied to taking widgets designed to work in the version 1.3 into a 3.0 environment.  Without changing the coding, 3.1 and then 3.2 were released, and the modifications I made to the custom widget started to work.  I had thought  it was failing to run because of the missing components, but I no longer believe that was the case.  Since the release of 3.2, I have had no problems at all with custom widgets or in updating our FLEX sites.

Corey
0 Kudos
JoeTack
New Contributor III
Still not out of the woods.  Using Flashbuilder 4.7, forked Viewer for flex 3.6, ArcGis API for flex 3.6, and followed the steps on GITHUB. 

Resulted in over 100 "Unable to resolve resource bundle "ESRIMessages" for locale "en_US".

Deleting the additional compiler arguments removed the errors and allowed the index.html to build and I could run the project.  However, none of the widget text labels are visible. 

Looking around for a solution, I've tried adding the framework_fb.swc for en_us to the flex build path - No change.  I've added locale\{locale} to the source path - No change.  Have tried different compiler arguments with no success.

Any help is appreciated.
0 Kudos
JoeTack
New Contributor III
After all that, it appears to be an issue with the location of the API or swc.  I copied the API from where it was sitting in a different drive letter to within the Adobe folder in program files and everything works now.
0 Kudos