>From that output, if I'm interpreting it correctly, core.swc loads, then common.swc. Common.swc seems to have a dependency on Button, which hasn't been loaded yet since only core has been loaded.
Should common.swc have a dependency on Button? If so, you will need to load mx.swc beforehand. I think the compiler/linker is smart enough not to request loading of RSLs that aren't used by the application. But then if your custom RSL needs Button the compiler/linker doesn't know that. On 4/16/13 5:06 PM, "Michael Baird" <[email protected]> wrote: > I've analyzed the link-report and also checked out the catalog XML. > > The main library, which gets compiled as core.swc and then treated as an > external-library (+ rsl) by all the other targets, has a catalog.xml that > contains references to mx.controls:Button. I had the main application > target generate a link-report and that also contains references to the > mx.controls:Button class. > > So the linkage "appears" to be correct according to these reports. > > I tried to change the main application target to use > -library-path+=core.swc instead of -external-library-path, but that > resulted in no change. > > Fun fact: I added a custom debug config to FlashBuilder and launched the > application. Here's the console result: > > [SWF] C:\<path>\oneplace_client.swf - 1,869,468 bytes after decompression > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > Loading library > [SWF] /core.swf - 1,612,732 bytes after decompression > Loading library > Loaded library 0 of 5 > Loading library > [SWF] /common.swf - 1,203,976 bytes after decompression > VerifyError: Error #1014: Class mx.controls::Button could not be found. > > Could I be missing a step to generate a valid RSL for the libraries (e.g. > addressing the *VerifyError*)? Here is my *core* library target: > <java jar="${compc.jar.path}" > failonerror="true" > fork="true"> > <jvmarg value="-Xmx512m"/> > <arg value='-debug=${debug}'/> > <arg > value='-local-fonts-snapshot=${FLEX_HOME}/frameworks/localFonts.ser'/> > <arg value='-load-config=${flex.config}'/> > <arg > value='-theme=${FLEX_HOME}/frameworks/themes/Halo/halo.swc'/> > <arg value='-source-path+=${lib.core}'/> > <arg value='-include-sources=${lib.core}'/> > <arg value='-output=${build.dir}/core.swc'/> > </java> > > Then the main application target: > <java jar="${mxmlc.jar.path}" > failonerror="true" > fork="true"> > <jvmarg value="-Xmx512m"/> > <arg value='-debug=${debug}'/> > <arg > value='-local-fonts-snapshot=${FLEX_HOME}/frameworks/localFonts.ser'/> > <arg value='-load-config=${flex.config}'/> > <arg > value='-theme=${FLEX_HOME}/frameworks/themes/Halo/halo.swc'/> > <arg value='-runtime-shared-libraries=${core.swf}'/> > <arg value='-external-library-path=${build.dir}/core.swc'/> > <arg value='-runtime-shared-libraries=${common.swf}'/> > <arg value='-external-library-path=${build.dir}/common.swc'/> > <arg > value='-runtime-shared-libraries=${swiz-framework-v1.4.0.swf}'/> > > <!-- CampaignWrapper Libs BEGIN --> > <arg value='-runtime-shared-libraries=${campaign_common.swf}'/> > <arg > value='-external-library-path+=${build.dir}/campaign_common.swc'/> > <arg value='-runtime-shared-libraries=${synchronization.swf}'/> > <arg > value='-external-library-path=${build.dir}/synchronization.swc'/> > <arg value='-source-path+=${lib.campaign}'/> > <!-- CampaignWrapper Libs END --> > > <arg value='-file-specs=${app.main}/${client.name}.mxml'/> > <arg value='-output=${build.dir}/${client.name}.swf'/> > <arg value='-link-report=${build.dir}/report.xml'/> > </java> > > (Note: those are all custom SWCs I'm treating as RSLs/external-libraries. > The Flex ones are loaded - or supposed to be loaded - through the > -load-config argument.) > > Any further ideas are greatly appreciated! > > > > On Tue, Apr 9, 2013 at 12:22 PM, Michael Baird <[email protected]> wrote: > >> I'll check out the link-report and see what's going on. The main >> application MXML target is generating one, which is used for the modules >> through load-externs. >> >> The externals indicated by the module target I provided are some of our >> common libraries that are built as SWCs earlier in the script. The Flex >> ones are only included through flex-config. >> e.g. >> <java jar="${compc.jar.path}" >> failonerror="true" >> fork="true"> >> <jvmarg value="-Xmx512m"/> >> <arg value='-debug=${debug}'/> >> <arg >> value='-local-fonts-snapshot=${FLEX_HOME}/frameworks/localFonts.ser'/> >> <arg >> value='-load-config=${FLEX_HOME}/frameworks/flex-config.xml'/> >> <arg >> value='-theme=${FLEX_HOME}/frameworks/themes/Halo/halo.swc'/> >> <arg value='-external-library-path+=${build.dir}/core.swc'/> >> <arg value='-runtime-shared-libraries=${core.swf}'/> >> <arg value='-source-path+=${lib.common}'/> >> <arg value='-include-sources=${lib.common}'/> >> <arg value='-output=${build.dir}/common.swc'/> >> </java> >> >> (core being another of our libraries) >> >> >> On Tue, Apr 9, 2013 at 12:12 PM, Alex Harui <[email protected]> wrote: >> >>> >>> >>> >>> On 4/9/13 10:41 AM, "Michael Baird" <[email protected]> wrote: >>> >>>> Okay, I understand the Sprite issue might be something wrong with our >>>> resource builder (yes, embedded assets and css compiled into a resource >>> SWF >>>> so I'll look for misconfigurations there). >>>> >>>> Shouldnt mx.controls.Button be included through the standard >>> flex-config or >>>> is that getting messed up because of the module externals? >>> Flex-config directs compile-time. It must be "ok" since you are getting >>> SWFs and then run-time errors. It is options like -external-library-path >>> that cause the linker to exclude classes, which is what you want, but then >>> you have to make sure they get loaded and loaded correctly. >>>> >>>> Do you happen to know what/how this changed from 4.1 to now? This same >>>> build script is working with SDK 4.1.0. >>> I don't know off-hand. It is possible that we got better at not requiring >>> mx components in spark apps. A link-report will tell you what classes are >>> ending up where. >>> >>> BTW, did you obfuscate the SWC names? I don't recognize common and >>> charting >>> as Flex SWCs. If you custom built these SWCs then there might be an issue >>> with what classes are in it. A SWC is a zip file and in it is a >>> catalog.xml >>> which is like a link-report: it tells you which classes are in the SWC. >>>> >>>> >>>> On Mon, Apr 8, 2013 at 9:16 PM, Alex Harui <[email protected]> wrote: >>>> >>>>> The -external-library-path options are forcing certain classes to not >>> be >>>>> linked into the SWF, but those classes are not being loaded into the >>>>> ApplicationDomain tree in a way that SWF can access it or aren't being >>>>> loaded at all. >>>>> >>>>> The XXXX_flash.display_Sprite class is probably an embedded asset and >>> not >>>>> an >>>>> actual Flash Player class. >>>>> >>>>> >>>>> On 4/8/13 5:41 PM, "Michael Baird" <[email protected]> wrote: >>>>> >>>>>> I have a large application with multiple shared libraries and >>> sub-modules >>>>>> that I'm trying to build through Ant and I'm running into issues... >>>>> hoping >>>>>> someone here can help. >>>>>> >>>>>> I'm currently targeting the latest AF release - 4.9.1 - and running >>> into >>>>> an >>>>>> issue where when I launch the Ant-built application, I receive one >>> Flash >>>>>> exception: >>>>>> VerifyError: Error #1014: Class mx.controls::Button could not be >>> found. >>>>>> then another: >>>>>> ReferenceError: Error #1065: Variable >>>>>> >>>>> >>> >>> _88d866d22da27af4b5978eeb7ebb39d5d661776417e03b75890d49335a9fed4d_flash_disp >>> l>> >>> a >>>>>> y_Sprite >>>>>> is not defined. >>>>>> >>>>>> This seems to indicate that the Flash player is not being included >>>>> somehow >>>>>> but I can't figure out why! >>>>>> >>>>>> Here is an example of one of my module targets: >>>>>> <target name="dashboard" >>>>>> depends="client"> >>>>>> <java jar="${mxmlc.jar.path}" >>>>>> failonerror="true" >>>>>> fork="true"> >>>>>> <jvmarg value="-Xmx512m"/> >>>>>> <arg value='-debug=${debug}'/> >>>>>> <arg >>>>>> value='-local-fonts-snapshot=${FLEX_HOME}/frameworks/localFonts.ser'/> >>>>>> <arg >>>>>> value='-load-config=${FLEX_HOME}/frameworks/flex-config.xml'/> >>>>>> <arg >>>>>> value='-theme=${FLEX_HOME}/frameworks/themes/Halo/halo.swc'/> >>>>>> <arg value='-source-path+=${lib.dashboard}'/> >>>>>> <arg value='-runtime-shared-libraries=${core.swf}'/> >>>>>> <arg >>> value='-external-library-path=${build.dir}/core.swc'/> >>>>>> <arg value='-runtime-shared-libraries=${common.swf}'/> >>>>>> <arg >>> value='-external-library-path=${build.dir}/common.swc'/> >>>>>> <arg value='-runtime-shared-libraries=${charting.swf}'/> >>>>>> <arg >>>>> value='-external-library-path=${build.dir}/charting.swc'/> >>>>>> <arg >>>>>> value='-file-specs=${lib.dashboard}/${view.dir}/DashboardView.mxml'/> >>>>>> <arg >>>>>> value='-output=${build.dir}/${view.dir}/DashboardView.swf'/> >>>>>> <arg value='-load-externs=${build.dir}/report.xml'/> >>>>>> </java> >>>>>> </target> >>>>>> >>>>>> FLEX_HOME is defined earlier in the build script as the path to the >>> 4.9.1 >>>>>> base directory. >>>>>> >>>>>> I have also tried using anttasks, and that is working a little better >>>>>> except when I load a module with charts - then I get another missing >>>>> class: >>>>>> VerifyError: Error #1014: Class mx.charts::CategoryAxis could not be >>>>> found. >>>>>> >>>>>> So overall it seems like I'm having linking issues, but I'm using >>> stock >>>>>> flex-configs that look like they are including the right libraries in >>> the >>>>>> right places. >>>>>> >>>>>> Any help is appreciate... thanks =) >>>>> >>>>> -- >>>>> Alex Harui >>>>> Flex SDK Team >>>>> Adobe Systems, Inc. >>>>> http://blogs.adobe.com/aharui >>>>> >>>>> >>> >>> -- >>> Alex Harui >>> Flex SDK Team >>> Adobe Systems, Inc. >>> http://blogs.adobe.com/aharui >>> >>> >> -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
