首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mxmlc错误:无法为区域设置"y“解析资源包"X”:ANT生成问题

mxmlc错误:无法为区域设置"y“解析资源包"X”:ANT生成问题
EN

Stack Overflow用户
提问于 2013-01-22 04:07:43
回答 1查看 2.9K关注 0票数 1

我知道这个话题有很多类似的问题和答案,但我仍然有同样的问题。到目前为止,我已经研究了thisthisthisthisthis等……无济于事。

当我试图在我的项目上运行ANT构建时,我总是得到这个错误。

代码语言:javascript
复制
    [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:

代码语言:javascript
复制
<target name="compile" depends="common-build.compile">
    <antcall target="flex-build.compile-air-application"/>   // line 8
</target>

这就引出了我的flex-build.xml (这是我将调用抛出错误的宏的地方):

代码语言:javascript
复制
<target name="compile-air-application">
    <compileSWF>      // line 50
        <compiler-options>
            <load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
        </compiler-options>
    </compileSWF>            
</target>

最后,包含错误的mxmlc调用的宏本身:

代码语言:javascript
复制
<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>

以下是我的编译器参数:

代码语言:javascript
复制
-locale=en_US,fr_FR -source-path=locale/{locale}

基本上我的文件夹结构是这样的

代码语言:javascript
复制
Proj 
  |-- src 
  |-- lib 
  |-- locale 
          |-- en_US
               |-- resources.properties     
          |-- fr_FR 
               |-- resources.properties 

有人能看到我的ANT构建出了什么问题吗?如果你需要更多的信息,我很乐意编辑并添加到帖子中。我在网上找到了无数的黑客:我一整天都在试图解决这个问题:/

提前感谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-22 22:07:23

仅供参考,对于任何其他有此问题的人,可通过添加以下两个指令进行修复:

代码语言:javascript
复制
            **<source-path>locale/{locale}</source-path>
            <include-resource-bundles>resources</include-resource-bundles>**

因此,mxmlc如下所示

代码语言:javascript
复制
<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>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14446360

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档