Problem finding external stylesheet: /application.css

thomas.auinger's Avatar


15 Mar, 2016 12:50 PM


I got my application.css at the default location such as src/main/resources/application.css.

The main class uses that CSS file such as

<mx:Style source="/application.css" />
However, at compile time the following error is thrown:
* What went wrong:
Execution failed for task ':compileFlex'.
> java.lang.Exception: mxmlc execution failed: Loading configuration file D:\Repositories\gradle\gradleFx\sdks\c74d9d2b30596e2e0eceb789a7da7d3f6ab53195\frameworks\flex-config.xmlD:\Workspaces\Flex\mpanel-frontend\src\main\flex\MarketingPanel.mxml(23): Error: Problem finding external stylesheet: /application.css

    &lt;mx:Style source=&quot;/application.css&quot; /&gt;</code>

  1. Support Staff 1 Posted by Yennick Trevels on 18 Mar, 2016 07:05 PM

    Yennick Trevels's Avatar

    Hi Thomas,

    The reason for this is that you're building a swf, in which case GradleFx doesn't use the "src/main/resources" directory. It only uses this directory when compiling a swc, since basically the files in there are added with the compc compiler's "-include-file" option.

    What you can do is create a "src/main/flex/assets" directory and put the css file in there. Then it will be included as a source and therefore it will be accessible in your mxml.

  2. 2 Posted by Julio Tobias on 24 Mar, 2016 05:55 PM

    Julio Tobias's Avatar

    I had the same problem. I chose to put the css in src/main/resources and refactor mxml to use "/../resources/application.css.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac