Search code examples
actionscriptflex4adobe

VerifyError: Error #1014: Class spark.components::HGroup could not be found


I created a simple flex application which contains following line of codes



    <?xml version="1.0" encoding="utf-8"?>
    <s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    </s:HGroup>


When I run this application in flex I got the following error on the browser

    

    VerifyError: Error #1014: Class spark.components::HGroup could not be found.

also there is a warning on the my flash builder console which follows

`This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.`

after that i setted -static-link-runtime-shared-libraries=true option in additional compiler arguments after that the above warning become error which follows

`Unable to locate specified base class 'spark.components.HGroup' for component class 'com.region.IRegion'.`

my flex sdk version is flex 4.6.0 Also I have the same problem in the case of s:Button Can you please suggest a solution for this problem?


Solution

  • Your flex application cannot have the root as HGroup. It need to be

    For flex web apps

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    </s:Application>
    

    And for AIR apps:

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    </s:WindowedApplication>