Problem finding external stylesheet: /application.css

thomas.auinger's Avatar

thomas.auinger

15 Mar, 2016 12:50 PM

Hi

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

Generic

? 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

Recent Discussions

24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM

 

06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM
07 Apr, 2016 07:43 AM
24 Mar, 2016 05:55 PM