Perhaps you have some test code or some sample class in the same directory as the main mxml file but didn't realize that the compiler would find it during compilation? This sample class may declare that it is supposed to be in the uk.co.vianet package but it is sitting in the root directory that houses the main .mxml file?
 
The MXML compiler relies on a naming convention to locate classes at compile time, which is roughly:
 
1. Only one public definition (class, interface, etc) should exist per file.
2. The file name should match the class name with a .as extension (or .mxml extension if implementation is in MXML)
3. The directory structure of the file should match the package structure.
 
 Instead of requiring you to setup a "project" and include each individual file that you want link into the SWF the mxmlc compiler searches out for classes based on this naming convention.
 
i.e. for the following ActionScript class used in an MXML application:
 
package com.mycompany
{
public class MyClass
{
    public function MyClass()
    {
    }
}
}
 
...it should be declared in the following directory structure using the correct filename:
 
    /com/mycompany/MyClass.as
 
Also, this assumes that the /com directory resides in one of the specified source path directories for the compiler, which may either be the directory that houses the main .mxml file (i.e. the file starting with <mx:Application>) or one of potentially several source paths explicitly configured either on the command line or (preferably) in a corresponding flex-config.xml referenced by --load-config=/path/to/your/flex-config.xml
 
Note that if the class uses the empty package,
 
package
{
public class MyClass
{
    public function MyClass()
    {
    }
}
}
 
Then it exists in the root of one of the source path directories.
 
 
 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of erik_jen5en
Sent: Tuesday, October 24, 2006 4:59 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] A file found in a source-path must have the same package structure

Hi all,

I am attempting to get a build environment working with the command
line tools.  So far I have an Ant build script that will build all
mxml files in a directory but I keep getting the following error,


A file found in a source-path must have the same package structure '',
as the definition's package, 'uk.co.vianet'.



Does anyone know what is causing this error, and how to solve it.  I don't seem to be able to find any info on it.

Thanks in advance,

Erik

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to