Flax icon indicating copy to clipboard operation
Flax copied to clipboard

simple network example crash on start-up

Open Zhuinden opened this issue 8 years ago • 6 comments

    05-02 18:48:54.869 1956-1956/com.codyengel.simplenetworking E/AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: com.codyengel.simplenetworking, PID: 1956
                                                                          java.lang.RuntimeException: Unable to resume activity {com.codyengel.simplenetworking/com.codyengel.simplenetworking.ui.list.ListActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'io.reactivex.Observable com.codyengel.flax.FlaxModel.getObservable()' on a null object reference
                                                                              at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986)
                                                                              at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017)
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
                                                                              at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                              at android.os.Looper.loop(Looper.java:135)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at java.lang.reflect.Method.invoke(Method.java:372)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                           Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.reactivex.Observable com.codyengel.flax.FlaxModel.getObservable()' on a null object reference
                                                                              at com.codyengel.flax.FlaxRenderer.getObservable(FlaxRenderer.java:51)
                                                                              at com.codyengel.flax.FlaxRenderer.<init>(FlaxRenderer.java:35)
                                                                              at com.codyengel.simplenetworking.ui.list.ListRenderer.<init>(ListRenderer.java:32)
                                                                              at com.codyengel.simplenetworking.ui.list.ListActivity.createRenderer(ListActivity.java:77)
                                                                              at com.codyengel.simplenetworking.AbstractFlaxActivity.onResume(AbstractFlaxActivity.java:50)
                                                                              at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
                                                                              at android.app.Activity.performResume(Activity.java:6076)
                                                                              at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2975)
                                                                              at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017) 
                                                                              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392) 
                                                                              at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                              at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                              at android.os.Looper.loop(Looper.java:135) 
                                                                              at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                              at java.lang.reflect.Method.invoke(Native Method) 
                                                                              at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

Zhuinden avatar May 02 '17 22:05 Zhuinden

Thanks this relates to issue #2 and will be addressed at that time. I'm assuming you manually killed the process from Android Studio?

CodyEngel avatar May 02 '17 22:05 CodyEngel

No I actually just started the program and it immediately crashed.

Zhuinden avatar May 02 '17 22:05 Zhuinden

Literally just downloaded repo as is, started simplenetworking app, and it crashes on startup.

Zhuinden avatar May 02 '17 22:05 Zhuinden

Hm strange, there were a few uncommitted changes but nothing that should have caused that. I'll pull down from master and take a look, thanks for reporting.

CodyEngel avatar May 02 '17 22:05 CodyEngel

I was able to replicate this issue running the app on API 19 (admittedly this wasn't tested on). The app works fine on API 25 and I'm going to assume that this is probably a fun issue related to API 19. If anyone notices this issue on API > 19 please respond here, otherwise when I get a chance I'll do some additional regression testing to check if other API levels are affected.

For now if you experience an issue with this sample, try running on API 25.

CodyEngel avatar May 02 '17 23:05 CodyEngel

I was running an emulator 5.1.1

Zhuinden avatar May 03 '17 06:05 Zhuinden