Android Question Strange error

Semen Matusovskiy

Well-Known Member
Licensed User
I reconstructed CLog function for Crashlytics communation
In Strates's Service_Create I create an instance javaobjectFirebaseCrashlytics = javaobjectFirebaseCrashlytics.InitializeStatic ("com.google.firebase.crashlytics.FirebaseCrashlytics").RunMethod ("getInstance", Null) and then use following subroutine to output results.
B4X:
Public Sub CLog (stringMessage As String)

     javaobjectFirebaseCrashlytics.RunMethod ("log", Array (stringMessage))
     If LastException.IsInitialized Then javaobjectFirebaseCrashlytics.RunMethod ("recordException", Array (LastException))
    Log (stringMessage)

End Sub

Crashlytics shows
Fatal Exception: java.lang.NullPointerException
Attempt to read from field 'com.quick.men.starter com.quick.men.guitasklist._starter' on a null object reference
com.quick.men.guitasklist._activity_resume (guitasklist.java:640)

Activity_Resume looks so
B4X:
Try
     ...
Catch
    Starter.Clog ("text")  
End Try

Crashlytics refers exactly to Starter.CLog.

I am a little confused by Attempt to read from field 'com.quick.men.starter com.quick.men.guitasklist._starter' on a null object reference
Starter is null ? How it could be ? Or I understand something wrong ?
 

Semen Matusovskiy

Well-Known Member
Licensed User
This happens in Activity_Resume, when programs rebuilds a form.
Sub Activity_Resume calls another soubroutines, which can call another subroutines.

All subroutines have the same layout ( Try .... Catch Starter.Clog). Crashlytics shows exception in Activity_Resume, but Crashlytics's log shows an error in latest subroutine, which I call (indirectly) in Activity_Resume event.

A problem that I am not able to reproduce this error on own phone.

Crashlytics talks that affected 0,5% of users. 88% of crashes is under Android 10, 12% - under Android 9. Mostly cheap models. Maybe not enough memory ?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
I wrote a program enough long ago, when it was maximum Android 8.
It seems to me, I expected that services can be killed by OS. Except Starter, which (as I thought) is not kill-able. Is it correct up to now ?

Erel --

Not enough information to say anything concrete.

What I need to check ?
 
Upvote 0
Top