Adding Joda Time to Android Studio

Solution 1:

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.

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

Solution 2:

I added joda time via File/Project Structure/Modules-App/Dependencies.

enter image description here

Clicking on + and Library dependency brings you to the dialog:

enter image description here

Here you can search for joda and add the actual version to your project. If you add it this way you don't have to manually download the newest version from github or manually write something into your build.gradle file. Android Studio does it all for you.

Solution 3:

I completely prefer to use jitpack.io repository.

In this case, you should get GitHub links of joda-time (just a simple search) and go to Jitpack.IO then search for the github link.

After all, you should get this page and do the instructions.

https://jitpack.io/#JodaOrg/joda-time/v2.9.4

Just sync your gradle and all done...