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 joda
. Does anyone have any idea of what I'm doing wrong?
For Android developers Joda-Time solves one critical problem: stale timezone data. Built-in timezone data is only updated when the OS is updated, and we all know how often that happens. Countries modify their timezones all the time; being able to update your own tz data keeps your app up-to-date and accurate.
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.
I added joda time
via File/Project Structure/Modules-App/Dependencies
.
Clicking on +
and Library dependency
brings you to the dialog:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With