Astatine0936 Astatine0936 - 3 months ago 83x
Android Question

Adding Joda Time to Android Studio

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:

Gradle Sync

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.

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
. Does anyone have any idea of what I'm doing wrong?


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

dependencies {    
    compile 'joda-time:joda-time:2.7' // for joda

you don't need anything else to do.

Updated(23rd Feb, 2016)

As of now latest version is 2.9.4 , so-

dependencies {    
        compile 'joda-time:joda-time:2.9.4' // for joda

You need the latest release, check out the release page and change the version no accordingly in the above line.