Android错误:包org.apache.tools.ant不存在

时间:2016-08-06 10:56:26

标签: android sardine

我正在尝试添加com.github.sardine库并使用它构建我的应用程序。 它失败并出现以下错误

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

需要解决方案。

2 个答案:

答案 0 :(得分:2)

将以下行添加到build.gradle中的依赖项(Module:app)会有所帮助。

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

答案 1 :(得分:0)

将其添加到 build.gradle(模块:应用)

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