JakeWharton / hugo

Annotation-triggered method call logging for your debug builds.
Apache License 2.0
7.92k stars 797 forks source link

NullPointerException with hugo #148

Open vashisthg opened 7 years ago

vashisthg commented 7 years ago

Getting null pointer exceptions with Hugo 1.2.1. Device Nexus6p, Android 7.1.1 (api 25)

Logs here:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Class.isAnonymousClass()' on a null object reference
at hugo.weaving.internal.Hugo.asTag(Hugo.java:97)
at hugo.weaving.internal.Hugo.asTag(Hugo.java:98)
at hugo.weaving.internal.Hugo.enterMethod(Hugo.java:71)
at hugo.weaving.internal.Hugo.ajc$inlineAccessMethod$hugo_weaving_internal_Hugo$hugo_weaving_internal_Hugo$enterMethod(Hugo.java:1)
at hugo.weaving.internal.Hugo.logAndExecute(Hugo.java:36)
ened commented 7 years ago

Did you or anyone else find a root cause / solution for this?

DanielGod commented 7 years ago

What's the cause of this?

marian-eremia commented 6 years ago

Had this problem recently. Seems to have been related to a listener imbrication (clickListener definition in another clickListener definition). Also this started happening after migration from source / target java version compatibility from 1.7 to 1.8.

Changed it to lambda expressions and it fixed it.

ebabel commented 6 years ago

@marian-eremia I'm getting this now, but moved to 1.8 a while ago. Could you elaborate on what exactly you changed?