18 Replies Latest reply on Aug 6, 2009 10:53 AM by Gaurav J

    Gumbo compc namespace manifest issue

    cksachdev Level 1

      Hi all,

      I am facing issue with a Flex Library Project (in Gumbo i.e. Flex 4 SDK). I am trying to package my components in a swc. I have done it in Flex 3 so I have doubt on, what are the changes in arguments supplied to compc. Here is the error, which I get:

      Could not resolve <s:SolidColor> to a component implementation.

      This error comes from a skin in my component, as follows:

      <s:SparkSkin xmlns="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">

      .<s:Rect id="base" height="100%" width="100%">
              <s:fill>
                  <s:SolidColor color="#ff0000"/>
              </s:fill>
      </s:Rect>
      </s:SparkSkin>

       

      This error comes when I try to introduce a manifest.xml and a namespace in my component library. If I don't set namespace and manifest file then my swc gets compiled and works without any issues. My guess is some new compiler arguments are introduced, but would like to know how it works.

       

      One more question is related to design view in Flex Builder. Where list of components are displayed in different folders, e.g. Controls, Layout, Custom etc. I have done it using a design.xml in flex 3, but I am not finding any xml file in flex sdk, which have the content like below:

      <design>
          <namespaces>
          </namespaces>
          <categories>
          </categories>
          <components>
          </components>
      </design>

       

      Please point me to the directory strucutre or the documentation.

       

      Thank you

       

      --

      Best Regards;

      Chetan Sachdev

        • 1. Re: Gumbo compc namespace manifest issue
          matt_chotin Level 3

          You may be running into this bug: http://bugs.adobe.com/jira/browse/SDK-20199

           

          As a workaround you can use += in your arguments instead of = for the manifest and that might work?

           

          I'm checking on the FB situation.

           

          Matt

          • 2. Re: Gumbo compc namespace manifest issue
            matt_chotin Level 3

            Also for design.xml try fully qualifying your classnames.  We keep those

            files for the framework in the Builder folders, not as part of the SWCs

            right now.

             

            Matt

            1 person found this helpful
            • 3. Re: Gumbo compc namespace manifest issue
              cksachdev Level 1

              I added the following arguments in "Additional compiler arguments"

               

              --namespace+=http://ns.adobe.com/mxml/2009,${flexlib}/mxml-2009-manifest.xml --namespace+=http://www.adobe.com/2006/mxml,${flexlib}/mxml-manifest.xml --namespace+=library://ns.adobe.com/flex/spark,${flexlib}/spark-manifest.xml

               

              Thanks Matt, It worked.

               

              When I try to compile using ant script, it is not working I am attaching my ant script file in attachment:

               

              Message was edited by: cksachdev

              • 4. Re: Gumbo compc namespace manifest issue
                Desiclimber Level 1

                I am trying to compile a spark skin file and it generates the swc file without any issues if i don't use my own namespace. As soon as i add namespace to it, i get the following error.

                 

                [compc] Error: could not find source for class spark.layouts:VerticalAlign in namespace library://ns.adobe.com/flex/spark.

                This is how the file looks like and if i use the most recent nightly build of the sdk then also i get the same problem.
                <?xml version="1.0"?>
                <project name="first" basedir="." default="main">
                    <taskdef resource="flexTasks.tasks" classpath="${basedir}/flexTasks/lib/flexTasks.jar" />
                <property name="FLEX_HOME" value="/Applications/Adobe Flash Builder Beta/sdks/4.0.0"/>
                <!--<property name="FLEX_HOME" value="/Users/nayan/Downloads/flex_sdk_4/"/>-->
                    <property name="DEPLOY_DIR" value="."/>
                    <property name="COMPONENT_ROOT" value="."/>
                   
                <target name="main">
                 
                    <compc output="${DEPLOY_DIR}/MyComps.swc" compiler.debug="false" compiler.optimize="" include-classes="components.MySkin components.Button1"
                target-player="10" directory="true">
                <source-path path-element="."/>
                <namespace uri="http://www.mydomain.com/2009" manifest="manifest.xml"/>
                <namespace uri="library://ns.adobe.com/flex/spark" manifest="${FLEX_HOME}/frameworks/spark-manifest.xml"/>
                <include-namespaces uri="http://www.mydomain.com/2009"/>
                <include-namespaces uri="library://ns.adobe.com/flex/spark"/>
                       <!--   <external-library-path dir="${FLEX_HOME}/frameworks/libs" >
                <include name="player/10/playerglobal.swc" />
                <include name="flex.swc" />
                <include name="flex4.swc" />
                <include name="framework.swc" />
                <include name="rpc.swc" />
                <include name="sparkskins.swc" />
                <include name="textLayout.swc" />
                <include name="utilities.swc" />
                </external-library-path>-->
                        </compc>
                    </target>
                  
                </project>
                I am not sure what i am missing here,
                thanks
                Nayan

                • 5. Re: Gumbo compc namespace manifest issue
                  gjastrab Level 1

                  I had also submitted this bug which is still under internal review (SDK-22032).  The same workaround was documented there, but I think this should be fixed or better documentation needs to be made for bundling your custom SWCs.

                  • 6. Re: Gumbo compc namespace manifest issue
                    Desiclimber Level 1

                    In the discussion, you mentioned that adding the namespaces did the trick for you but in my case even though i add namespaces it still doesn't compiles. I am going to watch this bug and hopefully they include the default namespaces in the compc task itself as you suggested.

                     

                    thanks

                    Nayan

                    • 7. Re: Gumbo compc namespace manifest issue
                      cksachdev Level 1

                      First of all, sorry for the late response. Could you please show me the error you are getting. I have worked on it a lot to make it work. If you can paste the error over the forum I might resolve it.

                       

                      Thank you

                       

                      --

                      Best Regards;

                      Chetan Sachdev

                      riageeks.com

                      • 8. Re: Gumbo compc namespace manifest issue
                        Desiclimber Level 1

                        I am using a catalyst skin file and then extending it in a custom class. I want to compile it using a custom namespace but i am not able to do so.

                         


                        If i just include my custom namespace, then i get the following error,

                         

                        [compc] Loading configuration file /Users/nayan/Downloads/flex_sdk_4/frameworks/flex-config.xml
                            [compc] /Users/nayan/Documents/Adobe Flash Builder Beta/compilercode/first/components/Button1.mxml(17): Error: Could not resolve <s:Transition> to a component implementation.
                            [compc]
                            [compc] <s:Transition fromState="disabled" toState="up" autoReverse="true">
                            [compc]

                         

                         

                         

                        if i add the following namespace to the build file,

                         

                        <namespace uri="library://ns.adobe.com/flex/spark" manifest="${FLEX_HOME}/frameworks/spark-manifest.xml"/>     
                        <namespace uri="http://ns.adobe.com/mxml/2009" manifest="${FLEX_HOME}/frameworks/mxml-2009-manifest.xml"/>
                        <namespace uri="http://www.adobe.com/2006/mxml" manifest="${FLEX_HOME}/frameworks/mxml-manifest.xml"/>

                         

                        <include-namespaces uri="library://ns.adobe.com/flex/spark"/>
                        <include-namespaces uri="http://ns.adobe.com/mxml/2009"/>
                        <include-namespaces uri="http://www.adobe.com/2006/mxml"/>

                         

                        i get the following error,

                         

                        main:
                            [compc] Loading configuration file /Users/nayan/Downloads/flex_sdk_4/frameworks/flex-config.xml
                            [compc] Error: could not find source for class spark.layouts:VerticalAlign in namespace library://ns.adobe.com/flex/spark.
                            [compc]

                         


                        I am not sure if its related to this issue or not. please find attached the files i am using. have posted this in http://bugs.adobe.com/jira/browse/SDK-22032 not sure if its related.

                         

                        thanks

                        Nayan

                        • 9. Re: Gumbo compc namespace manifest issue
                          Chet Haase Level 3

                          From the first error you posted below, I wonder if you're putting a Transition tag out in the open, instead of inside a <s:transitions> block. But I can't tell since you didn't post the code. I downloaded the attachment from the bug report, but I don't see a Button1 class there and the classes I did see didn't seem to match the code you're talking about.

                           

                          Try again, but post the code for Button1 that's throwing the Transition error...

                           

                          Chet.

                          • 10. Re: Gumbo compc namespace manifest issue
                            Desiclimber Level 1

                            Button1.mxml is a skin exported directly from Flash Catalyst, I am not writing that piece of code and it gets compiled without any problems if i don't include the namespaces.

                             

                             

                            It should be there in the zip file but here is another attachment.

                             

                             

                            thank you for your help.

                             

                            Nayan

                            • 11. Re: Gumbo compc namespace manifest issue
                              Chet Haase Level 3

                              Nope, didn't work - the forum strips the attachment when it emails it, and the zipfile appears corrupt on the forum itself. Can you simply paste the Button1 code in your reply?

                               

                              Chet.

                              • 12. Re: Gumbo compc namespace manifest issue
                                Desiclimber Level 1

                                <?xml version="1.0" encoding="utf-8"?>

                                 

                                <!--

                                 

                                    ADOBE SYSTEMS INCORPORATED

                                    Copyright 2008 Adobe Systems Incorporated

                                    All Rights Reserved.

                                 

                                    NOTICE: Adobe permits you to use, modify, and distribute this file

                                    in accordance with the terms of the license agreement accompanying it.

                                 

                                -->

                                 

                                <s:Skin xmlns:s="library://ns.adobe.com/flex/spark"

                                       alpha.disabled="0.5" xmlns:mx="library://ns.adobe.com/flex/halo">

                                    <s:transitions>

                                        <s:Transition fromState="disabled" toState="up" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect1}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect7}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                        <s:Transition fromState="down" toState="up" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect1}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect6}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                        <s:Transition fromState="up" toState="over" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect1}">

                                                    <s:Fade/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect0}">

                                                    <s:Fade/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                        <s:Transition fromState="up" toState="down" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect1}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect6}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                        <s:Transition fromState="over" toState="up" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect1}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect0}">

                                                    <s:Fade duration="0"/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                        <s:Transition fromState="over" toState="down" autoReverse="true">

                                            <s:Parallel>

                                                <s:Parallel target="{rect0}">

                                                    <s:Fade/>

                                                </s:Parallel>

                                                <s:Parallel target="{rect6}">

                                                    <s:Fade/>

                                                </s:Parallel>

                                            </s:Parallel>

                                        </s:Transition>

                                    </s:transitions>

                                    <fx:Metadata>

                                        [HostComponent("spark.components.Button")]

                                    </fx:Metadata>

                                 

                                    <s:states>

                                        <s:State name="up" />

                                        <s:State name="over" />

                                        <s:State name="down" />

                                        <s:State name="disabled" />

                                    </s:states>

                                 

                                    <!-- background -->

                                    <s:Rect x="0.5" y="0.5" width="69" height="22"

                                          radiusX="2" radiusY="2" id="rect1" includeIn="up">

                                        <s:fill>

                                            <s:LinearGradient rotation="90">

                                                <s:GradientEntry color="#3f3f3f" alpha="1.0" ratio="0"/>

                                                <s:GradientEntry color="#808080" ratio="0.5058823529411764" alpha="1.0"/>

                                                <s:GradientEntry color="#d8d8d8" ratio="0.9882352941176471" alpha="1.0"/>

                                            </s:LinearGradient>

                                        </s:fill>

                                        <s:stroke>

                                            <s:SolidColorStroke color="0x5380D0" weight="1"/>

                                        </s:stroke>

                                    </s:Rect>

                                 

                                    <!-- shadow (down state only) -->

                                    <s:Rect x="2" y="1" width="66" height="1" includeIn="down,over" id="rect5" visible="false">

                                        <s:fill>

                                            <s:SolidColor color="0x5380D0" alpha="0.25" />

                                        </s:fill>

                                    </s:Rect>

                                    <s:Rect x="1" y="2" width="68" height="1" includeIn="down,over" id="rect4" visible="false">

                                        <s:fill>

                                            <s:SolidColor color="0x5380D0" alpha="0.07" />

                                        </s:fill>

                                    </s:Rect>

                                    <s:Rect x="1" y="2" height="20" width="1" includeIn="down,over" id="rect3" visible="false">

                                        <s:fill>

                                            <s:SolidColor color="0x5380D0" alpha="0.07" />

                                        </s:fill>

                                    </s:Rect>

                                    <s:Rect x="68" y="2" height="20" width="1" includeIn="down,over" id="rect2" visible="false">

                                        <s:fill>

                                            <s:SolidColor color="0x5380D0" alpha="0.07" />

                                        </s:fill>

                                    </s:Rect>

                                    <s:Rect x="0.5" y="0.5" width="69" height="22"

                                          radiusX="2" radiusY="2" id="rect0" includeIn="over">

                                        <s:fill>

                                            <s:LinearGradient rotation="90">

                                                <s:GradientEntry color="#000000" alpha="1.0" ratio="0"/>

                                                <s:GradientEntry color="#808080" ratio="0.5058823529411764" alpha="1.0"/>

                                                <s:GradientEntry color="#d8d8d8" ratio="0.9882352941176471" alpha="1.0"/>

                                            </s:LinearGradient>

                                        </s:fill>

                                        <s:stroke>

                                            <s:SolidColorStroke color="0x5380D0" weight="1"/>

                                        </s:stroke>

                                    </s:Rect>

                                    <s:Rect x="0.5" y="0.5" width="69" height="22"

                                          radiusX="2" radiusY="2" id="rect6" includeIn="down">

                                        <s:fill>

                                            <s:LinearGradient rotation="90">

                                                <s:GradientEntry color="#3f3f3f" alpha="1.0" ratio="0"/>

                                                <s:GradientEntry color="#808080" ratio="0.5058823529411764" alpha="1.0"/>

                                                <s:GradientEntry color="#000000" ratio="0.9882352941176471" alpha="1.0"/>

                                            </s:LinearGradient>

                                        </s:fill>

                                        <s:stroke>

                                            <s:SolidColorStroke color="0x5380D0" weight="1"/>

                                        </s:stroke>

                                    </s:Rect>

                                    <s:Rect x="0.5" y="0.5" width="69" height="22"

                                          radiusX="2" radiusY="2" id="rect7" includeIn="disabled" alpha="0.4">

                                        <s:fill>

                                            <s:LinearGradient rotation="90">

                                                <s:GradientEntry color="#3f3f3f" alpha="1.0" ratio="0"/>

                                                <s:GradientEntry color="#808080" ratio="0.5058823529411764" alpha="1.0"/>

                                                <s:GradientEntry color="#d8d8d8" ratio="0.9882352941176471" alpha="1.0"/>

                                            </s:LinearGradient>

                                        </s:fill>

                                        <s:stroke>

                                            <s:SolidColorStroke color="0x5380D0" weight="1"/>

                                        </s:stroke>

                                    </s:Rect>

                                 

                                    <!-- label -->

                                    <s:RichText id="labelElement" text="(Label)"

                                             x="1" y="6" width="69"

                                             textAlign="center">

                                    </s:RichText>

                                 

                                </s:Skin>

                                 

                                 

                                This is the skin class i get from Flash Catalyst.

                                • 13. Re: Gumbo compc namespace manifest issue
                                  Chet Haase Level 3

                                  Sorry, I'm at a loss - I'm not sure how custom namespaces fit in with all of this.

                                   

                                  Here's what I'm seeing:

                                  - The skin you sent me won't compile as-is because it refers to the 'fx' namespace for the Metadata tag.

                                  - When I include the fx namespace (xmlns:fx="http://ns.adobe.com/mxml/2009"), the skin compiles and I can write/compile/run an app using that skin successfully.

                                  - I don't know what you're doing with a custom namespace in that skin. Presumably, if you don't have 's' referring to the spark namespace, the compiler would puke because it's heavily dependent on the spark namespace tags in that skin.

                                   

                                  I'm not sure this helps, but since I didn't see the "s:transitions" problem that I thought might be there, I'm not sure what is the real problem you're seeing.

                                   

                                  Seems like you have other people contributing to the forum post and to the original bug report - maybe they're going to be more help tracking down the custom namespace problem...

                                   

                                  Chet.

                                  • 14. Re: Gumbo compc namespace manifest issue
                                    Desiclimber Level 1

                                    here is my problem, maybe i should have given the bigger picture too. I want to compile this custom class which extends the skin and then load it into another application during run time.

                                     

                                     

                                    i can compile the class without the custom namespace but when i load the library.swf, created using directory=true in my build.xml, into another application there is no way to access that class,

                                     

                                     

                                     

                                    var currDomain:ApplicationDomain = ApplicationDomain.currentDomain;

                                    var onemore:Object = currDomain.getDefinition("spark.components.supportClasses::Skin");

                                    var tempObj:Object = currDomain.getDefinition("components::MySkin");

                                     

                                     

                                    I can access the other classes using this method but not my custom classes. is there any other way of loading swc classes during runtime, i don't want to create modules.

                                     

                                    hope it makes sense.

                                     

                                    Nayan

                                     

                                    Edit: sorry i removed the fx namespace from the skin file by mistake, the mx was added by me to try out something, should have removed that.

                                    • 15. Re: Gumbo compc namespace manifest issue
                                      Gaurav J Adobe Employee

                                       

                                      How are you loading the library.swf?

                                       

                                      If you are trying to load library.swf created using compc, then it should be loaded as an RSL.

                                       

                                      Thanks,

                                      Gaurav Jain

                                      Flex SDK Team

                                      http://www.gauravj.com/blog

                                      • 16. Re: Gumbo compc namespace manifest issue
                                        Desiclimber Level 1

                                        I am using swfloader to load the swf file, I am not sure how i would load a rsl during runtime, i can't specify it in the project settings. yes i am using compc.

                                         

                                         

                                        thank you for all the help.

                                         

                                        Nayan

                                        • 17. Re: Gumbo compc namespace manifest issue
                                          Gaurav J Adobe Employee

                                          Is there a reason why you don't want to use it as an RSL?

                                           

                                          RSLs are loaded at runtime. RSL gets loaded in frame1 i.e. before your swf gets initialized.

                                           

                                          Thanks,

                                          Gaurav Jain

                                          Flex SDK Team

                                          http://www.gauravj.com/blog

                                          • 18. Re: Gumbo compc namespace manifest issue
                                            Desiclimber Level 1

                                            yes i want these swc file classes to be available when the user clicks on a button or something like that, also the application in which these classes will be loaded will have no prior knowledge of them so i can't use them during compile time. 

                                             

                                            hope it makes sense, i cannot give the exact specifics of the project out on a public forum

                                             

                                            thanks,

                                            Nayan