Ant compilation error solution after Android SDK 26 (error message: taskdef A class needed by class com.android.ant.GetUiTargetTask)

Problem phenomenon:

build.xml:475: taskdef A class needed by class com.android.ant.GetUiTargetTask cannot be found: com/android/utils/ILogger
 using the classloader AntClassLoader[/usr/local/androidsdk/tools/lib/ant-tasks.jar:/usr/local/androidsdk/tools/lib/kxml2-2.3.0.jar:/usr/local/androidsdk/tools/lib/httpmime-4.1.jar:/usr/local/androidsdk/tools/lib/annotations-12.0.jar:/usr/local/androidsdk/tools/lib/commons-logging-1.1.1.jar]

The cause and solution of the problem:

After the AndroidSDK26 version, the components related to ant compilation have been deleted. If necessary, you can manually copy and add the corresponding files. The configuration is as follows:

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

 

Verify that recompilation can pass

I have compiled an attachment of the above documents and posted it here. After the review is passed, I will attach the link. The source of the file is android-sdk_r24.4.1-linux

https://download.csdn.net/download/xlyrh/12683071

 

Question reference link:

https://stackoverflow.com/questions/42577491/taskdef-a-class-needed-by-class-com-android-ant-getuitargettask-cannot-be-found/43337226

Guess you like

Origin blog.csdn.net/xlyrh/article/details/107766878