android-用“ ant debug”构建osmand给出错误

我已经从这里签出了最新的Osmand源代码
然后从这里开始执行所有步骤

现在我正在尝试使用命令ant debug通过ant构建apk,但失败

我执行以下命令:

myname@myname-VirtualBox:~/dev/osmand/android/OsmAnd$ant -f build.xml
which gives output as
BUILD SUCCESSFUL

当我尝试之后

myname@myname-VirtualBox:~/dev/osmand/android/OsmAnd$ant debug

最后失败,并显示以下日志:

-crunch:
   [crunch] Crunching PNG Files in source dir: /home/moonshooter/dev/osmand/android/OsmAnd/res
   [crunch] To destination dir: /home/moonshooter/dev/osmand/android/OsmAnd/bin/res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:

BUILD Failed
/home/myname/dev/osmand/android/OsmAnd/build.xml:27: The following error occurred while executing this line:
/home/myname/dev/osmand/android/OsmAnd/build.xml:28: Missing attribute libraryRFileRefid

Total time: 18 seconds

xml中的第27和28行是

<do-only-if-not-library elseText="Library project: do not package resources...">
                    <aapt executable="${aapt}" command="package" versioncode="${version.code}"versionname="${version.name}" debug="${build.is.packaging.debug}" manifest="${out.manifest.abs.file}"assets="${asset.absolute.dir}" androidjar="${project.target.android.jar}" apkfolder="${out.absolute.dir}"nocrunch="${build.packaging.nocrunch}" resourcefilename="${resource.package.file.name}"resourcefilter="${aapt.resource.filter}" libraryResFolderPathRefid="project.library.res.folder.path"libraryPackagesRefid="project.library.packages" prevIoUsBuildType="$`enter code here`{build.last.target}"buildType="${build.target}" ignoreAssets="${aapt.ignore.assets}">

这是整个文件http://pastebin.com/Dv20iT8r

谁能告诉我是什么问题?

解决方法:

只需在aapt标记添加属性libraryRFileRefid =“ project.library.bin.r.file.path”

<do-only-if-not-library elseText="Library project: do not package resources...">
            <aapt executable="${aapt}" command="package" versioncode="${version.code}" versionname="${version.name}" debug="${build.is.packaging.debug}" manifest="${out.manifest.abs.file}" assets="${asset.absolute.dir}" androidjar="${project.target.android.jar}" apkfolder="${out.absolute.dir}" nocrunch="${build.packaging.nocrunch}" resourcefilename="${resource.package.file.name}" resourcefilter="${aapt.resource.filter}" libraryRFileRefid="project.library.bin.r.file.path" libraryResFolderPathRefid="project.library.res.folder.path" libraryPackagesRefid="project.library.packages" prevIoUsBuildType="${build.last.target}" buildType="${build.target}" ignoreAssets="${aapt.ignore.assets}">
                <res path="${out.res.absolute.dir}" />
                <res path="${resource.absolute.dir}" />
                <!-- <nocompress /> forces no compression on any files in assets or res/raw -->
                <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
            </aapt>
        </do-only-if-not-library>

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...