Search code examples
flashapache-flexflex4.5flashbuilder4

Flash Builder 4.5 the import could not be found


I just upgraded from Flash Builder 4 to 4.5 and have imported one of my FB 4 projects. I am now seeing an orange question mark in the gutter next to all of my import statements that are importing local classes (as well as everywhere the said class methods are used) and an orange underline appears under the import statement. When I hover over the underline it says that the import could not be found.

The project compiles and runs without a problem (I use ANT to build this project).

If I open one of the class files in question then change something (i.e press space bar) and hit save (EDIT: actually found I don't have to even save, just opening causes FB to find it) then go back to the file importing it the orange question mark is gone for that import, I get the code assist and CTL+Click links me to the class file. However, if I close that file and reopen it again cannot find the class file.

The classes in question are stored under my project's src dir as:

 - src
  +---com
      +---myappname
          +---services
          +---utils
          etc...

and my import statements look like:

import com.myappname.utils.*;
import com.myappname.services.remoteService;

Any ideas? Is this a FB 4.5 "enhancement"? I've tried deleting and re-importing the project, refreshing the project and am now kind of at a loss of what to do. It's annoying enough that I may need to downgrade to 4.


Solution

  • Fixed!

    The project in question is a Flex/Air application and includes a folder inside the default "src" folder that houses a web application server (railo) that runs locally when the Air app is launched to provide "server side" functionality to the Air client. This folder was only in the src folder so that it would be packaged in the Air installer. However, I found that if I remove the directory, all my import references start to work just fine.

    I still needed the folder inside src folder so that it would package properly, so I simply moved it to the project root (outside of src) then created a "link" to it in the src folder. This keeps my import references intact, and includes the folder in the exe build.

    I'm not sure why including that folder causes this problem (it does not include any AS3 or MXML files), but I'm thrilled that it was an easy fix.