1

我在as3中嵌入了一个png,在windows上都很好,使用FB4.6或Ant。但是在 linux(debian) 下使用 Ant 构建时,我得到了这个错误。图片路径为/var/lib/jenkins/workspace/q5/dev_Flash/code/Copper/src/assets/c001_up.png. 项目名称是/var/lib/jenkins/workspace/q5/dev_Flash/code/Copper

[mxmlc] /var/lib/jenkins/workspace/q5/dev_Flash/code/Copper/src/com/copper/ui/skin/DefaultAssets.as(10): col: 3: Error: unable to resolve 'assets/c001_up.png' for transcoding
[mxmlc] 
[mxmlc]         [Embed(source = "assets/c001_up.png")]
[mxmlc]   ^
[mxmlc] 
[mxmlc] /var/lib/jenkins/workspace/q5/dev_Flash/code/Copper/src/com/copper/ui/skin/DefaultAssets.as(10): col: 3: Error: Unable to transcode assets/c001_up.png.

像这样的as3文件

package com.copper.ui.skin {


/**
 * 
 * @author marzwu
 *
 */
public class DefaultAssets extends Assets {
    [Embed(source = "assets/c001_up.png")]
    private var Button_Up:Class;

我的蚂蚁文件是:

<?xml version="1.0" encoding="UTF-8"?>

Q5客户端制造</p>

<!-- 配置属性 -->
<property file="build.properties" />

<property environment="env" />
<property name="FLEX_HOME" value="${env.FLEX_HOME}" />

<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

<target name="compile">
    <echo message="${basedir}/../src" />
    <compc output="../bin/copper.swc" debug="false" incremental="true">
        <!-- 指定Comman项目的源码目录 -->
        <source-path path-element="${basedir}/../src" />
        <!-- 指定编译的文件列表 -->
        <include-sources dir="${basedir}/../src">
                <include name="**/*.as" />
        </include-sources>
        <!-- 将Flex SDK 作为外部库进行引用 -->
        <compiler.external-library-path dir="${FLEX_HOME}/frameworks">
            <include name="**/*.swc" />
        </compiler.external-library-path>
        <!-- 添加项目中的SWC包,请注意这里是外部 -->
        <compiler.external-library-path dir="../libs">
            <include name="**/*.swc" />
        </compiler.external-library-path>

        <define name="CONFIG::Debug" value="true" />
        <define name="CONFIG::Release" value="false" />

        <jvmarg value="-Xmx2048m"/>
        <jvmarg value="-Xms512m"/>
        <jvmarg value="-XX:MaxPermSize=512m"/>
    </compc>
    <!-- 删除缓存文件 -->
    <delete>
        <fileset dir="../bin" includes="*.cache" />
    </delete>
    <echo message="complier Flex Library Project finished!" />
</target>

<target name="deploy">
    <antcall target="compile" />
    <!--antcall target="copy_to_bin" /-->
    <echo>前往查看结果:http://10.0.1.69/q5d/</echo>
    <echo message="执行发布" />
</target>

我使用 jenkins 构建我的 as3 项目。困扰了我很多天。感谢您的帮助。

4

1 回答 1

0

糟糕,编译器无法解析路径,因为我没有注意到“c001_up.png”之间的“u”是大写字母。Windows 对字母大小写不敏感,但 linux 是。我的错,谢谢你的时间。

于 2013-03-22T14:34:09.410 回答