Problem finding external stylesheet: /application.css
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
<mx:Style source="/application.css" /></code>
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
Support Staff 1 Posted by Yennick Trevels on 18 Mar, 2016 07:05 PM
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 Posted by Julio Tobias on 24 Mar, 2016 05:55 PM
I had the same problem. I chose to put the css in src/main/resources and refactor mxml to use "/../resources/application.css.