Com.android.ant.SetupTask not found.

I will need to create one Android application from the command line. I successfully compiled its jni part, but cannot create the Java part. ant prints the following (paths removed):

 /.../build.xml:69: taskdef class com.android.ant.SetupTask cannot be found using the classloader AntClassLoader[/path/to/sdk/tools/lib/ant-tasks.jar:/path/to/sdk/tools/lib/manifest-merger.jar:/path/to/sdk/tools/lib/common.jar:/path/to/sdk/tools/lib/guava-13.0.1.ja r:/path/to/sdk/tools/lib/sdklib.jar:/path/to/sdk/tools/lib/layoutlib-api.jar:/path/to/sdk/tools/lib/kxml2-2.3.0.jar:/path/to/sdk/tools/lib/dvlib.jar:/path/to/sdk/tools/lib/bcpkix-jdk15on-1.4 8.jar:/path/to/sdk/tools/lib/commons-compress-1.0.jar:/path/to/sdk/tools/lib/httpclient-4.1.1.jar:/path/to/sdk/tools/lib/httpmime-4.1.jar:/path/to/sdk/tools/lib/bcprov-jdk15on-1.48.jar:/path /to/sdk/tools/lib/httpcore-4.1.jar:/path/to/sdk/tools/lib/commons-logging-1.1.1.jar:/path/to/sdk/tools/lib/commons-codec-1.4.jar] 

SetupTask seems to be inside anttasks.jar , but it is not in my sdk directory. I tried to install all available sdks, tried to add ant-tasks.jar to the class path (it has a similar name), but without success. Is there a way to install anttasks.jar , or is it replaced with something else? Or is SetupTask deprecated somehow?

I ran:

 android update project ... 

I tried to find google answer, but without success for this specific problem ( AntClassLoader not empty, anttasks.jar missing).

Thanks Daniel

+4
source share
2 answers

Afaik SetupTask has been deprecated in Android 2.3 and higher. It seems to me that you are working with the old version of build.xml. Starting with Android 2.3 and higher, there is a new template for build.xml in the your-Android-SDK / tools / ant / directory. You can change this to suit your needs.

Perhaps this link will help you, she pointed me in the right direction:

https://sites.google.com/site/sokolkosta/internal-blog/includingadditionaljavaxpackagesinandroid23

+1
source

fooobar.com/questions/602258 / ... This worked for me.

 rm MyProjects/NowRedux/build.xml android update project --target 8 --path MyProjects/NowRedux 
+1
source

Source: https://habr.com/ru/post/1485712/


All Articles