Android error: package org.apache.tools.ant does not exist

3.3k Views Asked by At

I'm trying to add com.github.sardine library and build my app with it. It fails with the following error

Error:(3, 28) error: package org.apache.tools.ant does not exist

Solution is needed.

2

There are 2 best solutions below

0
On

Adding of the following line to dependencies in build.gradle (Module: app) helps.

dependencies {
...
    compile group: 'org.apache.ant', name: 'ant', version: '1.8.2'
}
0
On

Add that to your build.gradle(Module: app)

android {
    useLibrary 'org.apache.http.legacy'
}