0

I'm fairly new to Android development and I'm having trouble with external library dependencies at the moment. In particular I've imported a jar file that has upstream dependencies on another package which it can't locate. The package I imported is trying to import java.time.format.SimpleDateTimeTextProvider. I found a jar which apparently contains this package, but when I add it to my project the error still appears. When I try to import the same package into my own source code for the main activity, there are no errors, so it clearly is a standard part of Java and available somewhere on the machine I am working on.

Is there a way to force imported packages to look for packages they are dependant on by searching the rest of the machine? Alternatively, is there another common way of dealing with this? Lastly, does someone know (just in case there is something wrong with the package I've already tried) where I can find a jar file containing java.time.format.SimpleDateTimeTextProvider?

Thanks in advance.

Terry Rozmus
  • 396
  • 3
  • 17
  • `SimpleDateTimeTextProvider` is a standard class of Java. Did you install the Java on your PC? Also which lib do you want to add to your project? – Dmitriy Mitiai Oct 05 '18 at 09:02
  • Yes, Java is installed. I am working on a Mac though. As I said, if I import the module into my own project it works fine. The problem is that external jars I have imported into my project in Android Studio can't see it for some reason. I probably should have made clear that it is an external jar I was having trouble with. I'll edit my post to make this clearer. – Terry Rozmus Oct 05 '18 at 19:28
  • Correction: the module my imported jar library couldn't find before was java.time.format.DateTimeFormatter. After I added a jar called java-time-backport-1.0.0.jar, it could find this. This jar also apparently contains java.time.format.SimpleDateTimeTextProvider, but neither the imported library jar that originally generated import erros, nor my own project source can find it. I'm confused as to why this is the case if java.time.format.SimpleDateTimeTextProvider is a standard part of Java. – Terry Rozmus Oct 05 '18 at 19:44
  • I just found another Stackoverflow post which appears to indicate why this is happening, but there was no resolution given: https://stackoverflow.com/questions/45327729/java-lang-noclassdeffounderror-java-time-format-datetimeformatter#_=_ I may have to revise my approach to this problem. – Terry Rozmus Oct 05 '18 at 20:01

0 Answers0