Android Question App crashes- Notificationlistener [Solved]

Discussion in 'Android Questions' started by Multiverse app, Jun 13, 2018.

  1. Multiverse app

    Multiverse app Active Member Licensed User

    As mentioned here: https://www.b4x.com/android/forum/t...hes-due-to-starter-service-not-running.91661/ in newer B4A versions, when the app is reopened after a long time, the Starter service fails to start. After the app launch, it takes 5-10 seconds to start the Starter service.
    The crashes haven't stopped even after updating to B4A 8.30 (which was supposed to fix them).
    If the user interacts with any element before that time (which, they will), the app crashes. without any error log.

    More than 4,000 crashes occur every week, and a large number of users are uninstalling the app because of these crashes. This seems to happen in only my biggest project. And so, I cannot replicate the issue.


    logs-

    Code:
    -Start-                                           '<---- App starts
    State: 16842910
    State: 
    16843597
    -
    End-
    Yeah, it 
    is!
    ** 
    Activity (main) Resume **
    Starting 
    Intent: no extras
    #-auth_TokenAvailable, Success=
    true
    ** 
    Activity (main) Pause, UserClosed = false **
    ** 
    Activity (main) Resume **
    Starting 
    Intent: no extras
    mobile data state: CONNECTED wifi_on: 
    0 server ip: 10.1.106.168
    wifi ip: 
    127.0.0.1
    InternetCommands                                                 
    '<----------- THE APP CRASHES HERE
    Notification internal service created
    *** 
    Service (starter) Create ***                             '<----------- THE SERVICE STARTS AFTER THE APP CRASH
    FirebaseAuth initialized
    ** 
    Service (starter) Start **
    mobile data state: CONNECTED wifi_on: 
    0 server ip: 10.1.106.168
    wifi ip: 
    127.0.0.1
    mobile data state: CONNECTED wifi_on: 
    0 server ip: 10.1.106.168
    wifi ip: 
    127.0.0.1
    onAuthStateChanged: com.google.firebase.auth.internal.zzj@dbcc5ee
    Error getting consent state: java.lang.Exception: Unable 
    to resolve host "adservice.google.com": No address associated with hostname
    Consent state: NON_PERSONALIZED
    Consent state: NON_PERSONALIZED
    EU: 
    false
    Voice initialization failed
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    ** 
    Service (notificationservice) Start **
    Can something be done?
    Help will be really appreciated!
     
    Last edited: Jun 14, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    The issue discussed in that thread was fixed and confirmed to be fixed in v8.30.

    Parts of the logs are missing. Where is Activity Create message? The starter service should not be started again until the process is killed.
    Are you stopping the starter service? Are you explicitly starting the starter service?
     
  3. Multiverse app

    Multiverse app Active Member Licensed User

    Sorry, I removed some sensitive information (the logs are from a working project). I've attached the full logs here.

    No, and no.
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    This is indeed not related to link posted in the first post.
    The logs, when a notification message arrives while the process is not running, should look like this:


    ** Receiver (firebasemessaging) OnReceive **
    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Service (firebasemessaging) Create **
    ** Service (firebasemessaging) Start **
    Message arrived
    Message data: {body=2, title=2}


    The receiver should be the first line.

    If it is not then it is likely that you are using an old version of FirebaseNotifications.
    The latest version is 1.21. Make sure that there isn't any old copy of FirebaseNotifications in the internal libraries folder.
     
  5. Multiverse app

    Multiverse app Active Member Licensed User

    Hi Erel,
    I am sorry, but I do not understand. There was no Firebasenotification sent in the entire runtime. The service is just initialized.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    What is notificationservice? Are you using GCM push notifications in your code?
     
    Multiverse app likes this.
  7. Multiverse app

    Multiverse app Active Member Licensed User

    Aah! It is a notification listener service.
     
  8. Multiverse app

    Multiverse app Active Member Licensed User

    adding
    Code:
    StartServiceAtExact(Starter, DateTime.Now, True)
    at Activity_Resume, I do not get any crashes.
     
  9. DonManfred

    DonManfred Expert Licensed User

    No comment :)
     
    Last edited: Jun 14, 2018
    Multiverse app likes this.
  10. Erel

    Erel Administrator Staff Member Licensed User

    The problem happens because of the notification listener service. Are you using the latest version (2.00) ?
     
  11. Multiverse app

    Multiverse app Active Member Licensed User

    NotificationListner 1.20 Cannot find ver 2.0 in the forums.
     
    Last edited: Jun 14, 2018
  12. Multiverse app

    Multiverse app Active Member Licensed User

    I mean I did not add it when the above crashes happened, just saying it helps :p
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    Multiverse app likes this.
  14. Multiverse app

    Multiverse app Active Member Licensed User

    victormedranop likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice