6 Replies Latest reply on Jun 24, 2009 9:31 AM by Gaurav J

    compc build fails when targeting FP10 and referencing AIR classes?

    borfgordon

      Hi,

      I have a project that is targeted for the AIR runtime. For example in my classes I reference the URLRequestMethod.HEAD constant.

       

      If I use compc and include the following libraries under the SDK (3.2 or 3.3) things compile A-OK

       

      frameworks/libs/air/*.swc

      frameworks/libs/player/9/*.swc

       


      If the only thing I change is reference the FP10 swc instead of the player 9 swcs, I get these compile errors

       

      frameworks/libs/air/*.swc

      frameworks/libs/player/10/*.swc

       

      AIRUrlStreamClient.as(29): col: 34 Error: Access of possibly undefine
      d property HEAD through a reference with static type Class.

       

                              req.method = URLRequestMethod.HEAD;

       


      What is the difference between the playerglobal.swc files that would cause such an error between the player 9 or player 10 swc files?

        • 1. Re: compc build fails when targeting FP10 and referencing AIR classes?
          Gaurav J Adobe Employee

          URLRequestMethod.HEAD is for AIR only.

           

          How are you compiling, you should use acompc for your AIR projects.

           

          Thanks,

          Gaurav Jain

          Flex SDK Team

          http://www.gauravj.com/blog

          • 2. Re: compc build fails when targeting FP10 and referencing AIR classes?
            borfgordon Level 1

            Hi,

            Please see the above post. I am building an SWC that has AIR dependancies. I am using compc and specifying all of the necessary libraries via the "include-library"/"include-external-library" options on the command line. When compiling one of my include libraries options points to "frameworks/libs/air/*.swc"  to include all of the AIR libs.

             

            Point being is that my build succeeds when I am building with the FP 9 playerglobal.swc librariy, but fails with the above error when using the FP 10 playerglobal.swc libs.

             

            Why would this be the case? What is different within 9/playerglobal.swc vs 10/playerglobal.swc which would cause this compilation error?

            • 3. Re: compc build fails when targeting FP10 and referencing AIR classes?
              Gaurav J Adobe Employee

              frameworks/libs/air/*.swc contains airglobal.swc which is the superset of playerglobal.swc. So you shouldn't be mixing the two.

               

              URLRequestMethod is present in both but the URLRequestMethod in playerglobal doesn't have URLRequestMethod.HEAD

               

              If it worked when you had 9/playerglobal.swc in the path, that is just by chance because airglobal.swc was being picked first. It may fail to compile with that setting also.

               

               

              Thanks,

              Gaurav Jain

              • 4. Re: compc build fails when targeting FP10 and referencing AIR classes?
                borfgordon Level 1

                Ahh, so what you are saying is that

                 

                a) if I am doing an build for AIR, I should skip the playerglobal all together, and only reference the libs/AIR/**.swcs?

                 

                b) otherwise include the 9 or 10 player global?

                 

                c) OR, is this simply an adjustment of the include-library option where the AIR libs are always there before the playerglobal libs? Or is the command line order irrelevant and the compiler just does what it wants?

                • 5. Re: compc build fails when targeting FP10 and referencing AIR classes?
                  Gaurav J Adobe Employee

                  there are two seperate configuration files (if you look under the frameworks folder) flex-config.xml and air-config.xml

                   

                  flex-config.xml is used by default,but air-config.xml should be used for AIR compiles. If you use acompc or amxmlc it uses air-config.xml instead of flex-config.

                   

                   

                  >> a) if I am doing an build for AIR, I should skip the playerglobal all together, and only reference the libs/AIR/**.swcs?

                  >>b) otherwise include the 9 or 10 player global?

                   

                  Yes, libs/air/*.swc should be in your library-path but you should keep libs/air/airglobal.swc in your external-library-path

                   

                  >> c) OR, is this simply an adjustment of the include-library option where the AIR libs are always there before the playerglobal libs? Or is the command >> line order irrelevant and the compiler just does what it wants?

                   

                  The order in which libs are specified on the command line is irrelevant.

                   

                  Thanks,

                  Gaurav Jain

                  • 6. Re: compc build fails when targeting FP10 and referencing AIR classes?
                    borfgordon Level 1

                    Thanks, I put a switch in my build script which simply does something like

                     

                    if (air) {

                              include the AIR libs only

                    } else {

                         bring in the 9/10 playerglobal.swc

                    }

                     

                    and things compile OK now