gpt4 book ai didi

android - taskdef 找不到类 com.android.ant.GetUiTargetTask 需要的类 : com/android/utils/ILogger

转载 作者:行者123 更新时间:2023-11-29 15:39:48 28 4
gpt4 key购买 nike

在我将 Android Studio 更新到版本 2.3 后,当我制作我的项目时出现此错误

/Users/xxx/Work/yyy/build.xml:96: taskdef A class needed by class com.android.ant.GetUiTargetTask cannot be found: com/android/utils/ILogger using the classloader AntClassLoader[/Users/xxx/Library/Android/sdk/tools/lib/ant-tasks.jar:/Users/xxx/Library/Android/sdk/tools/lib/kxml2-2.3.0.jar:/Users/xxx/Library/Android/sdk/tools/lib/gson-2.2.4.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-compress-1.8.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpclient-4.1.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpmime-4.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/httpcore-4.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-logging-1.1.1.jar:/Users/xxx/Library/Android/sdk/tools/lib/commons-codec-1.4.jar] at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:612) at org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java:408) at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:264) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:93) at org.apache.tools.ant.Main.runBuild(Main.java:832) at org.apache.tools.ant.Main.startAnt(Main.java:236) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113) Caused by: java.lang.NoClassDefFoundError: com/android/utils/ILogger at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:579) ... 16 more Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1384) at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1333) at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 19 more

这是 build.xml 中提到的代码行

<taskdef resource="anttasks.properties" classpathref="android.antlibs" />
<property name="exe" value="" />
<property name="bat" value="" />

在更新之前我从未见过这个错误。我如何修复此错误。

最佳答案

你需要从仍然有它们的工具中复制提到的文件,比如 windows 版本:

ant/*
lib/ant-tasks.jar
lib/common.jar
lib/sdklib.jar
lib/guava-17.0.jar
lib/manifest-merger.jar

关于android - taskdef 找不到类 com.android.ant.GetUiTargetTask 需要的类 : com/android/utils/ILogger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42577491/

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