gpt4 book ai didi

android - 使用 "ant debug"构建 osmand 会出错

转载 作者:太空宇宙 更新时间:2023-11-03 13:29:13 27 4
gpt4 key购买 nike

我从这里查看了最新的 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 - 使用 "ant debug"构建 osmand 会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15433872/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com