Hello,
I got a crash report in my Google Play Developer console and it says the following and I think it's all related to my Process_Globals sub..
java.lang.NullPointerException
in my.app.here.main._process_globals
Page 2 of the same report it says:
In my Process_Globals and Globals sub from the Main Activity it looks like this:
In my Process_Globals and Globals sub from the Activity1 Activity it looks like this:
In my Process_Globals and Globals sub from the Activity2 Activity it looks like this:
In my Activity1 Globals I have for some reason added 'Dim Panel1 As Panel' there twice.
Could this be the thing stuffing up my app ?
I also thought I wasn't using 'Initialize' in the Globals and thought I was doing that in the Activity_Create sub but looks like I am not, so could this also stuff up the app and the reason why its creating this crash report.
The thing I like to know as well, why does my app work fine on my 4 Android devices, but on some other devices this crash happens ? (maybe android devices are all different in a way?)
Anyone know why my app happens to crash based on the above?
(I don't want to upload my project to the forum)
I got a crash report in my Google Play Developer console and it says the following and I think it's all related to my Process_Globals sub..
java.lang.NullPointerException
in my.app.here.main._process_globals
B4X:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at my.app.here.activity1.initializeProcessGlobals(activity1.java:406)
at my.app.here.activity1.afterFirstLayout(activity1.java:94)
at my.app.here.activity1.access$100(activity1.java:16)
at my.app.here.activity1$WaitForLayout.run(activity1.java:76)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4950)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at my.app.here.activity1.initializeProcessGlobals(activity1.java:404)
... 12 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at my.app.here.main.initializeProcessGlobals(main.java:689)
... 15 more
Caused by: java.lang.NullPointerException
at my.app.here.main._process_globals(main.java:1242)
at my.app.here.main.initializeProcessGlobals(main.java:661)
... 15 more
Page 2 of the same report it says:
B4X:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at my.app.here.activity2.initializeProcessGlobals(activity2.java:329)
at my.app.here.activity2.afterFirstLayout(activity2.java:94)
at my.app.here.activity2.access$100(activity2.java:16)
at my.app.here.activity2$WaitForLayout.run(activity2.java:76)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5414)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at my.app.here.activity2.initializeProcessGlobals(activity2.java:327)
... 12 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at my.app.here.main.initializeProcessGlobals(main.java:689)
... 15 more
Caused by: java.lang.NullPointerException
at my.app.here.main._process_globals(main.java:1242)
at my.app.here.main.initializeProcessGlobals(main.java:661)
... 15 more
In my Process_Globals and Globals sub from the Main Activity it looks like this:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL1 As SQL
Dim sync_done, IP, PORT As String
Dim intCount As Int
Dim num_of_connections As Int = intCount
Dim MainTimer As Timer
Dim publicKey As String
publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCA.............."
Dim test1 As String
Public DeviceBoardPassword, BoardUrl, SenderId, DeviceName As String
DeviceBoardPassword = "test"
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim add_tap As Label
Dim add_tap1 As Label
Dim Fade_splash As SplashFade ' Used for splash screen
Dim scvTest As ScrollView 'used on showing layout in scrollView
Dim add_panel As Panel 'used on showing layout in scrollView
Dim menu_scroll As HorizontalScrollView 'used to add bottom menu
Dim menu_back_img As ImageView 'used to add bottom menu (background image)
Dim scvMain1 As ScrollView
Dim scvMain As ScrollView
Dim PanelNb As Int : PanelNb = 32
Dim PanelNb1 As Int : PanelNb1 = 32
Dim PanelHeight As Int : PanelHeight = 56dip
Dim PanelHeight1 As Int : PanelHeight1 = 60dip
Dim next_location As Int : next_location = 60dip
Dim num_of_items As Int : num_of_items = 0
Dim zone_list As Panel
Dim Days(7) As String
Dim ac1 As AHQuickAction ' used to show popup
Dim item As String ' used to show popup
Dim img_button As ImageView
Dim lbl2 As Label
' ---------------------------------------------------------------------------------------------
' used for menu button
Dim main_settings_button As ImageView
Dim men As AHPopupMenu
'----------------------------------------------------------------------------------------------
Dim SQL1 As SQL ' Used for getting data from database
Dim version_num As Label
End Sub
In my Process_Globals and Globals sub from the Activity1 Activity it looks like this:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL1 As SQL ' Used for getting data from database
Dim sql_panel_number As String = 1
Dim IP As String
Dim PORT As String
Dim runTimer As Timer ' used for dialog
Dim panel_state As String
Dim clearSync As Timer
Dim connectiontimer As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim scvTest As ScrollView 'used on showing layout in scrollView
Dim Panel1 As Panel 'used on showing layout in scrollView
Dim menu_scroll As HorizontalScrollView 'used to add bottom menu
Dim Panel1 As Panel
Dim panel_armed_ball As ImageView
Dim panel_ready_ball As ImageView
Dim Button1 As Button
Dim Button2 As Button
Dim Button3 As Button
Dim Button4 As Button
Dim Button5 As Button
Dim Button6 As Button
Dim Button7 As Button
Dim Button8 As Button
Dim Button9 As Button
Dim Button10 As Button
Dim Button11 As Button
Dim Button12 As Button
Dim current_panel_status As String
Dim pin As String
Dim keypad_icon As ImageView
Dim label2 As Label
Dim label3 As Label
Dim input_icon As ImageView
Dim output_icon As ImageView
Dim AB, AB2 As ClsActionBar
Dim HSV As HorizontalScrollView
Dim pnlAB As Panel
Dim pnlMain As Panel
Dim RadioButton1 As RadioButton
Dim RadioButton2 As RadioButton
Dim RadioButton3 As RadioButton
Dim RadioButton4 As RadioButton
Dim ToggleDividers As ToggleButton
Dim ToggleEquallySized As ToggleButton
Dim ToggleCustomBackground As ToggleButton
Dim AddButton As Button
Dim LastTab As View
Dim BtnHome As View
Dim menu_function_side_button As ImageView
Dim menu_quick_arm_side_button As ImageView
Dim show_quick_arm_menu_timer As Timer
show_quick_arm_menu_timer.Initialize ("show_quick_arm_menu_timer",1)
show_quick_arm_menu_timer.Enabled = False
Dim hide_quick_arm_menu_timer As Timer
hide_quick_arm_menu_timer.Initialize ("hide_quick_arm_menu_timer",1)
hide_quick_arm_menu_timer.Enabled = False
Dim hide_quick_function_menu_timer As Timer
hide_quick_function_menu_timer.Initialize ("hide_quick_function_menu_timer",1)
hide_quick_function_menu_timer.Enabled = False
Dim connecting_panel As Panel
Dim title_1 As Label
Dim title_2 As Label
Dim connecting_top_title As Label
Dim connection_err_button As Button
Dim kpareatimer As Timer
kpareatimer.Initialize("kpareatimer",2000)
kpareatimer.Enabled = True
kpareatimer.Interval = 2000
Dim hide_quick_arm As Label
Dim hide_quick_function As Label
Dim quck_function_panel As Panel
Dim fkey_flashing As Timer
fkey_flashing.Initialize("fkey_flashing",1000)
fkey_flashing.Enabled = True
fkey_flashing.Interval = 1000
Dim current_flashing_F1,current_flashing_F2,current_flashing_F3,current_flashing_F4,current_flashing_F5,current_flashing_F6 As String = "0"
Dim connecting_panel_error As Panel
connecting_panel_error.Initialize (connecting_panel_error)
Dim title_1_a As Label
title_1_a.Initialize(title_1_a)
Dim panel_time_date_label As Label
Dim checkTime_and_status As Timer ' used to check if time/date & panel status is shown as a backup
Dim main_settings_button As ImageView
Dim men As AHPopupMenu
Dim main_title As Label
Dim label1 As Label 'connected / not connected label
End Sub
In my Process_Globals and Globals sub from the Activity2 Activity it looks like this:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim datab As local_storage1
Dim Timer1 As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim scvTest As ScrollView 'used on showing layout in scrollView
Dim add_panel As Panel 'used on showing layout in scrollView
Dim ULV As ClsUltimateListView
Dim ItemHeight As Int = 50dip
Dim CancelList As List
Dim Cancel1List As List
Dim menu_scroll As HorizontalScrollView
Dim ac1 As AHQuickAction
Dim item As String
Dim AB, AB2 As ClsActionBar
Dim HSV As HorizontalScrollView
Dim pnlAB As Panel
Dim pnlMain As Panel
Dim RadioButton1 As RadioButton
Dim RadioButton2 As RadioButton
Dim RadioButton3 As RadioButton
Dim RadioButton4 As RadioButton
Dim ToggleDividers As ToggleButton
Dim ToggleEquallySized As ToggleButton
Dim ToggleCustomBackground As ToggleButton
Dim AddButton As Button
Dim LastTab As View
Dim BtnHome As View
Dim main_settings_button As ImageView
Dim men As AHPopupMenu
Dim main_title As Label
Dim loaded As String = "0"
End Sub
In my Activity1 Globals I have for some reason added 'Dim Panel1 As Panel' there twice.
Could this be the thing stuffing up my app ?
I also thought I wasn't using 'Initialize' in the Globals and thought I was doing that in the Activity_Create sub but looks like I am not, so could this also stuff up the app and the reason why its creating this crash report.
The thing I like to know as well, why does my app work fine on my 4 Android devices, but on some other devices this crash happens ? (maybe android devices are all different in a way?)
Anyone know why my app happens to crash based on the above?
(I don't want to upload my project to the forum)