Closed iporat08 closed 4 years ago
yes this is a problem that occurs when running the app again using the green "play" button in android studio, when you already have a firebase user. We reccomend clearing the data of the application before doing that, or just run it again using the "restart button" (right next to the regular "run" button)
Every now and then when I open the app it crashes with the following error:
2020-06-27 21:55:13.300 22305-22305/com.example.roome E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.roome, PID: 22305 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.roome/com.example.roome.MainActivityApartmentSearcher}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.database.DataSnapshot com.google.firebase.database.DataSnapshot.child(java.lang.String)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.database.DataSnapshot com.google.firebase.database.DataSnapshot.child(java.lang.String)' on a null object reference at com.example.roome.FirebaseMediate.getApartmentSearcherUserByUid(FirebaseMediate.java:216) at com.example.roome.MainActivityApartmentSearcher.getCurrentApartmentSearcherUser(MainActivityApartmentSearcher.java:279) at com.example.roome.MainActivityApartmentSearcher.onCreate(MainActivityApartmentSearcher.java:68) at android.app.Activity.performCreate(Activity.java:7183) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)