When i try to access the getInstance method it thr...
# announcements
m
When i try to access the getInstance method it throws NoSuchFieldError. Why is it so?
e
Are you trying to create a Singleton? If so change your
class EmailService
to
object EmailService
and you're done 😉
m
Thanks @Elias M. ! But what could be the reason for such an exception?
k
Do not take actual pictures of code.
âž• 3
🙂 2
a
@muralimohan962 where is
isInitialised
declared?
k
It's something from Kotlin itself.
m
Hmm @karelpeeters!
k
It would be great if we could run the code ourselves, but that's impossible because someone was dumb enough to take a picture of their screen.
🔥 2
a
What was the complete stack trace? It should show what was not initialised
h
Try cleaning your screen maybe that helps
🤔 1
😄 1