Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-34752

Problem with build ant (Error: Incorrect number of arguments. Expected no more than 0.)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Apache Flex 4.14.0
    • None
    • Ant Tasks
    • OS X Yosemite Version 10.10.2. Apache Flex 4.14 and Adobe AIR 16.0

    Description

      Problem in compiling the action script that uses flash.display.NativeMenuItem using flexTask.jar (ant).
      Error:

      Darlans-MacBook-Pro:testeGridComp darlan$ ant
      Buildfile: /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml
      
      compile:
           [echo] Compiling build/testeGridComp.swc
          [compc] Loading configuration file /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/compile-config.xml
          [compc] /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/src/br/com/test/Test.as(8): col: 61 Error: Incorrect number of arguments.  Expected no more than 0.
          [compc] 
          [compc] 			var fileMenu:NativeMenuItem = new NativeMenuItem("test", false);
          [compc] 			                                                         ^
          [compc] 
      
      BUILD FAILED
      /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml:30: compc task failed.
      
      Total time: 1 second
      Darlans-MacBook-Pro:testeGridComp darlan$ clear
      
      Darlans-MacBook-Pro:testeGridComp darlan$ ant
      Buildfile: /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml
      
      compile:
           [echo] Compiling build/testeGridComp.swc
          [compc] Loading configuration file /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/compile-config.xml
          [compc] /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/src/br/com/test/Test.as(8): col: 67 Error: Incorrect number of arguments.  Expected no more than 0.
          [compc] 
          [compc] 			var nativeMenuItem:NativeMenuItem = new NativeMenuItem("test", false);
          [compc] 			                                                               ^
          [compc] 
      
      BUILD FAILED
      /Users/darlan/Documents/Adobe Flash Builder 4.6/testeGridComp/build.xml:30: compc task failed.
      
      Total time: 1 second
      

      Code:

      package br.com.test
      {
      	import flash.display.NativeMenuItem;
      
      	public class Test
      	{
      		public function createMenu():void {
      			var nativeMenuItem:NativeMenuItem = new NativeMenuItem("test", false);
      		}
      	}
      }

      Ant:

      <project name="testeGridComp" default="compile" basedir=".">
      	<property file="${basedir}/build.properties"/>
          <property file="${basedir}/env.properties"/>
          <property environment="env"/>
      	<target name="compile" description="Compile testeGridComp.swc">
      		<echo message="Compiling build/testeGridComp.swc"/>
      		<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
      		<compc fork="true"
      			   output="${basedir}/build/testeGridComp.swc">
                  <jvmarg line="${compc.jvm.args}"/>
                  <load-config filename="${basedir}/compile-config.xml" />
      			<include-sources dir="${basedir}/src" includes="*"/>
                  <arg value="+playerglobal.version=${playerglobal.version}" />
                  <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
      			<arg value="+env.FLEX_HOME=${FLEX_HOME}" />
      		</compc>
      	</target>
      </project>
      

      Attachments

        1. testeGridComp.zip
          9 kB
          Darlan Araújo dos Santos

        Activity

          People

            Unassigned Unassigned
            darlan.ads Darlan Araújo dos Santos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: