2

Facing this issue since yesterday , searched a lot but didn't found any solution , can anybody help?

Getting following error:

Could not find class 'org.joda.time.DateTime', referenced from method com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder.

Log:

Could not find class 'org.joda.time.DateTime', referenced from method com.raizlabs.android.dbflow.config.GeneratedDatabaseHolder.<clinit>
06-01 11:10:16.521 8973-8973/org.hispindia.bidtrackerreports E/AndroidRuntime: FATAL EXCEPTION: main
                                                                               java.lang.RuntimeException: Unable to create application org.hispindia.bidtrackerreports.HIApplication: java.lang.RuntimeException: 
Pavya
  • 6,015
  • 4
  • 29
  • 42
Sourabh
  • 101
  • 1
  • 2
  • 5

2 Answers2

1

If you are using Android studio you can add

compile 'joda-time:joda-time:2.3'

or you can add joda-time-2.3.jar into lib folder.

In the file picker, just select the joda-time-2.3-sources.jar file. And you're done and add the line

compile files('libs/joda-time-2.3.jar')

Krutik
  • 732
  • 6
  • 19
  • Error only comes for version 4.0 (api 14), working fine on 5.0 – Sourabh Jun 01 '16 at 06:00
  • Are you using latest version? https://github.com/JodaOrg/joda-time/releases also put multiDexEnabled true in build.gradle and also you had to make custom Application extend MultiDexApplication – Krutik Jun 01 '16 at 06:14
  • But why there is no error coming for 5.0 or api >19 – Sourabh Jun 01 '16 at 06:26
  • It is on same link with title Multidex support prior to Android 5.0 and Is your problem resolved? – Krutik Jun 01 '16 at 09:00
0

I had multidex enabled in my .gradle, to resolve this issue I extended my Application with MultiDexApplication:

public class Application extends MultiDexApplication 

For more information refer to the developer guide: https://developer.android.com/reference/android/support/multidex/MultiDexApplication.html

goemic
  • 1,092
  • 12
  • 24