CodyEngel / Flax

Flax is another way to build Android applications.
Apache License 2.0
32 stars 2 forks source link

simple network example crash on start-up #4

Open Zhuinden opened 7 years ago

Zhuinden commented 7 years ago
    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) 
CodyEngel commented 7 years ago

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

Zhuinden commented 7 years ago

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

Zhuinden commented 7 years ago

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

CodyEngel commented 7 years ago

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 commented 7 years ago

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.

Zhuinden commented 7 years ago

I was running an emulator 5.1.1