android10 / frodo

Android Library for Logging RxJava Observables and Subscribers.
1.48k stars 101 forks source link

App is crashing with NullPointerException on Android 4.2.2 #23

Closed coolerfall closed 8 years ago

coolerfall commented 8 years ago

Caused by: java.lang.NullPointerException at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27) I just use Observable.just(SomethingList), but sometimes SomethingList will be a empty list(not null), or when I use Observable.empty(), and then it is crashing when use @RxLogObservable.

Nexen23 commented 8 years ago

Same here. Any workarounds?

aleksandar9 commented 8 years ago

Hi You can use the following sample to reproduce the issue:

@Override
@RxLogObservable
public Observable<UserBo> getTrainLayout(String userId) {
    UserBo userBo = new UserBo(userId);
    return Observable.just(userBo);
}

Also, I can confirm it not only crashes on Android 4.2.2, but also on Android 4.4.2 with the following log:

Caused by: java.lang.NullPointerException 
at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)

After some debugging I discovered that LogObservable.java:25 final Annotation annotation = frodoJoinPoint.getAnnotation(RxLogObservable.class); is actually null and therefore causing the crash.

aleksandar9 commented 8 years ago

I see that this issue might be resolved in version 0.8.3, I hope it will be published soon enough ;)

paramsen commented 8 years ago

I'm experiencing this as well: java.lang.NullPointerException at com.fernandocejas.frodo.aspect.LogObservable.methodAnnotatedWithRxLogObservable(LogObservable.java:27)

android10 commented 8 years ago

This was fixed here: https://github.com/android10/frodo/commit/33dea2c4f28c7d4eefc9f9811d23e91fc7c35a01

Releasing a new version next week. Thanks for reporting.

dawidhyzy commented 8 years ago

Same issue on Android 4.4.2

android10 commented 8 years ago

Closing since version 0.8.3 has been released 😃