将Joda Time添加到Android Studio [英] Adding Joda Time to Android Studio

查看:366
本文介绍了将Joda Time添加到Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Joda网站获取了文件,并按照以下说明进行操作

I got the file from the Joda site and followed these instructions for adding libraries but when I get to the Gradle sync I end up with the error:

成绩同步

Error:Configuration with name 'default' not found.

Gradle Build

Error:A problem occurred configuring project ':app'. 
> Cannot evaluate module joda : Configuration with name 'default' not found.

有些困惑,我环顾四周,读到该库应该有它自己的gradle文件,但joda包没有.当我尝试使用import org.joda.time;时,它无法解析joda.有人知道我在做什么错吗?

A bit confused, I looked around and read that the library should have it's own gradle files but the joda package doesn't. When I try to use import org.joda.time; it can't resolve joda. Does anyone have any idea of what I'm doing wrong?

推荐答案

在app/build.gradle文件中,像这样添加-

in app/build.gradle file, add like this-

dependencies {    
    compile 'joda-time:joda-time:2.9.4'
}

您无需执行其他任何操作.

You don't need to do anything else.

您需要最新版本,请查看发布页面 https://github.com/JodaOrg /joda-time/releases 并相应地更改版本.

You need the latest release, check out the release page https://github.com/JodaOrg/joda-time/releases and change the version accordingly.

这篇关于将Joda Time添加到Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆