我从the Joda site获取文件,并按照for adding libraries 的指示进行操作,但是当我进入Gradle同步时,我遇到了以下错误:
Gradle同步
Error:Configuration with name 'default' not found.
Gradle构建
Error:A problem occurred configuring project ':app'.
> Cannot evaluate module joda : Configuration with name 'default' not found.
有点困惑,我环顾四周,读到该库应该有它自己的gradle文件,但joda包没有。当我尝试使用
import org.joda.time;
时,无法解析joda
。有人知道我在做什么错吗? 最佳答案
在app/build.gradle文件中,像这样添加-
dependencies {
compile 'joda-time:joda-time:2.9.4'
}
您无需执行其他任何操作。
您需要最新版本,请查看发行页面https://github.com/JodaOrg/joda-time/releases并相应地更改版本。