ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

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

2019-10-31 05:25:44  阅读:258  来源: 互联网

标签:build osmdroid android ant


我已经从这里签出了最新的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>

标签:build,osmdroid,android,ant
来源: https://codeday.me/bug/20191031/1973378.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有