我知道这个话题有很多类似的问题和答案,但我仍然有同样的问题。到目前为止,我已经研究了this、this、this、this、this等……无济于事。
当我试图在我的项目上运行ANT构建时,我总是得到这个错误。
[mxmlc] Error: Unable to resolve resource bundle "resources" for locale "en_US".
BUILD FAILED
C:\***\flashWorkspace\shop\build.xml:8: The following error occurred while executing this line:
C:\***\flashWorkspace\Scripts\flex-build.xml:50: The following error occurred while executing this line:
C:\***\flashWorkspace\Scripts\flex-build.xml:123: mxmlc task failed我的build.xml:
<target name="compile" depends="common-build.compile">
<antcall target="flex-build.compile-air-application"/> // line 8
</target>这就引出了我的flex-build.xml (这是我将调用抛出错误的宏的地方):
<target name="compile-air-application">
<compileSWF> // line 50
<compiler-options>
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
</compiler-options>
</compileSWF>
</target>最后,包含错误的mxmlc调用的宏本身:
<macrodef name="compileSWF">
<element name="compiler-options" optional="yes"/>
<attribute name="sourceDir" default="${src.dir}"/>
<attribute name="libraryDir" default="${build.lib.dir}"/>
<attribute name="buildDir" default="${build.dir}"/>
<attribute name="locale" default="${locale}"/>
<attribute name="applicationFile" default="${application.file}"/>
<attribute name="outputFile" default="${swf.file}"/>
<sequential>
<delete file="@{buildDir}/@{outputFile}"/>
<mxmlc file="@{sourceDir}/@{applicationFile}" output="@{buildDir}/@{outputFile}" locale="@{locale}"> //line 123
<compiler-options/>
<source-path path-element="@{sourceDir}"/>
<compiler.library-path dir="@{libraryDir}" append="true">
<include name="*.swc"/>
</compiler.library-path>
</mxmlc>
</sequential>
</macrodef>以下是我的编译器参数:
-locale=en_US,fr_FR -source-path=locale/{locale}基本上我的文件夹结构是这样的
Proj
|-- src
|-- lib
|-- locale
|-- en_US
|-- resources.properties
|-- fr_FR
|-- resources.properties 有人能看到我的ANT构建出了什么问题吗?如果你需要更多的信息,我很乐意编辑并添加到帖子中。我在网上找到了无数的黑客:我一整天都在试图解决这个问题:/
提前感谢
发布于 2013-01-22 22:07:23
仅供参考,对于任何其他有此问题的人,可通过添加以下两个指令进行修复:
**<source-path>locale/{locale}</source-path>
<include-resource-bundles>resources</include-resource-bundles>**因此,mxmlc如下所示
<mxmlc file="@{sourceDir}/@{applicationFile}" output="@{buildDir}/@{outputFile}" locale="@{locale}">
<compiler-options/>
<source-path>locale/{locale}</source-path>
<include-resource-bundles>resources</include-resource-bundles>
<source-path path-element="@{sourceDir}"/>
<compiler.library-path dir="@{libraryDir}" append="true">
<include name="*.swc"/>
</compiler.library-path>
</mxmlc>https://stackoverflow.com/questions/14446360
复制相似问题