gpt4 book ai didi

ant - com.android.ant.NewSetupTask 升级到 SDK v20 工具后未找到错误

转载 作者:行者123 更新时间:2023-12-04 23:06:13 25 4
gpt4 key购买 nike

升级到 v20 SDK 工具后,我在尝试运行 Ant 构建时收到此错误。

sdk.dir 属性正确且经过验证(添加到 build.xml 中的输出)。解压 anttasks.jar 似乎在最新的工具中确实缺少 NewSetupTask。

META-INF/
META-INF/MANIFEST.MF
com/
com/android/
com/android/ant/
com/android/ant/RenderScriptTask.class
com/android/ant/SingleDependencyTask$1.class
com/android/ant/PropertyByReplaceTask.class
com/android/ant/BuildTypedTask.class
com/android/ant/AaptExecTask$1.class
com/android/ant/AaptExecTask$ResFolderInputPath.class
com/android/ant/AaptExecTask$NoCompress.class
com/android/ant/ApkBuilderTask.class
com/android/ant/GetLibraryPathTask.class
com/android/ant/InputPath.class
com/android/ant/RenderScriptTask$OptLevel.class
com/android/ant/TaskHelper.class
com/android/ant/XPathTask.class
com/android/ant/ManifestMergerTask.class
com/android/ant/DependencyHelper$LibraryProcessor.class
com/android/ant/CheckEnvTask.class
com/android/ant/RenderScriptTask$1.class
com/android/ant/ApkBuilderTask$SourceFolderInputPath.class
com/android/ant/DependencyHelper$JarProcessor$1.class
com/android/ant/ComputeDependencyTask.class
com/android/ant/SingleInputOutputTask.class
com/android/ant/GetLibraryPathTask$1.class
com/android/ant/RenderScriptTask$RenderScriptProcessor.class
com/android/ant/SignApkTask.class
com/android/ant/DependencyHelper$JarProcessor.class
com/android/ant/SignApkTask$NullZipFilter.class
com/android/ant/DependencyHelper$AdvancedLibraryProcessor.class
com/android/ant/DependencyGraph.class
com/android/ant/ComputeDependencyTask$1.class
com/android/ant/DexExecTask.class
com/android/ant/MultiFilesTask.class
com/android/ant/AidlExecTask$1.class
com/android/ant/DependencyHelper.class
com/android/ant/AidlExecTask.class
com/android/ant/BuildConfigTask.class
com/android/ant/ApkBuilderTask$1.class
com/android/ant/AaptExecTask.class
com/android/ant/SingleDependencyTask.class
com/android/ant/DependencyGraph$1.class
com/android/ant/ZipAlignTask.class
com/android/ant/GetTypeTask.class
com/android/ant/GetEmmaFilterTask.class
com/android/ant/IfElseTask.class
com/android/ant/DependencyGraph$DependencyStatus.class
com/android/ant/AidlExecTask$AidlProcessor.class
com/android/ant/ComputeProjectClasspathTask.class
com/android/ant/SingleDependencyTask$InputPathFactory.class
com/android/ant/GetTargetTask$1.class
com/android/ant/MultiFilesTask$DisplayType.class
com/android/ant/MultiFilesTask$SourceProcessor.class
com/android/ant/GetProjectPathsTask.class
com/android/ant/SignApkTask$1.class
com/android/ant/GetTargetTask.class
com/android/ant/ComputeDependencyTask$2.class
com/android/ant/GetLibraryPathTask$LeafProcessor.class
anttasks.properties

去哪儿了?

最佳答案

问题源于我使用的是完全自定义的 build.xml 文件。因此,它包含以下自定义 ant 任务定义:

<taskdef name="setup"
classname="com.android.ant.NewSetupTask"
classpathref="android.antlibs" />

<taskdef name="aapt"
classname="com.android.ant.AaptExecTask"
classpathref="android.antlibs" />

<taskdef name="aidl"
classname="com.android.ant.AidlExecTask"
classpathref="android.antlibs" />

<taskdef name="renderscript"
classname="com.android.ant.RenderScriptTask"
classpathref="android.antlibs" />

<taskdef name="dex"
classname="com.android.ant.DexExecTask"
classpathref="android.antlibs" />

<taskdef name="apkbuilder"
classname="com.android.ant.ApkBuilderTask"
classpathref="android.antlibs" />

<taskdef name="zipalign"
classname="com.android.ant.ZipAlignTask"
classpathref="android.antlibs" />

<taskdef name="xpath"
classname="com.android.ant.XPathTask"
classpathref="android.antlibs" />

<taskdef name="if"
classname="com.android.ant.IfElseTask"
classpathref="android.antlibs" />
anttasks.jar 不再提供其中的一个或多个图书馆。将我的 build.xml 文件与位于 {sdk.dir}/tools/ant/build.xml 的文件进行比较我注意到这些定义已被替换为以下内容:
<taskdef resource="anttasks.properties" classpathref="android.antlibs" />

替换旧的任务定义。在我的 build.xml 文件中,这个新的任务 def 语句删除了对丢失任务的引用并解决了我的问题。

关于ant - com.android.ant.NewSetupTask 升级到 SDK v20 工具后未找到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11527624/

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