https://kotlinlang.org logo
Title
m

muralimohan962

08/05/2018, 5:34 AM
When i try to access the getInstance method it throws NoSuchFieldError. Why is it so?
e

Elias M.

08/05/2018, 6:38 AM
Are you trying to create a Singleton? If so change your
class EmailService
to
object EmailService
and you're done 😉
m

muralimohan962

08/05/2018, 7:11 AM
Thanks @Elias M. ! But what could be the reason for such an exception?
k

karelpeeters

08/05/2018, 7:25 AM
Do not take actual pictures of code.
🙂 2
3
a

asad.awadia

08/05/2018, 1:10 PM
@muralimohan962 where is
isInitialised
declared?
k

karelpeeters

08/05/2018, 1:12 PM
It's something from Kotlin itself.
m

muralimohan962

08/05/2018, 1:16 PM
Hmm @karelpeeters!
k

karelpeeters

08/05/2018, 1:17 PM
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

asad.awadia

08/05/2018, 1:19 PM
What was the complete stack trace? It should show what was not initialised
h

Henrykvdb

08/05/2018, 3:05 PM
Try cleaning your screen maybe that helps
🤔 1
😄 1