Android Question RemoteServiceException error, where to look for ?

FrancisDu09

Member
Licensed User
Hi,

I need help, i get theses errors in play console but i do not know where to look in my code.
android.app.RemoteServiceException
android.app.ActivityThread$H.handleMessage

These errors seem to be present only on Samsung devices.

I have a background service
I have a notif service

Can you give me some advices on where to look for error.
Thanks
Francis

Error detail:
android.app.RemoteServiceException:
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2019)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:158)
  at android.app.ActivityThread.main (ActivityThread.java:7225)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
 

FrancisDu09

Member
Licensed User
I think i did all the necessary according to your guide, i can run app with crashlytics, i can run app with crashlytics and exception error at startup but nothing in firebase console.
Crashlytics page in console keep on box 'add the sdk, then build'
Crashlytics service is active but it is as it was not.
 
Last edited:
Upvote 0

FrancisDu09

Member
Licensed User
I installed 10.2b and crashlytics.
App seems to be ok with 10.2b.
Is there any reason not to publish my app with 10.2b or it is ok if i think app is ok ?
Thanks
 
Upvote 0

FrancisDu09

Member
Licensed User
Thanks Erel for your support.
I published a new version with 10.2b and Crashlytics enabled, and i got my first results !

It has to do with notification icon, on certains devices, because on my 4 devices (diff brands and diff os versions) it is ok.

Error is :

Fatal Exception: android.app.RemoteServiceException
Bad notification posted from package sdfpstudio.abmusictrainer: Couldn't update icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=sdfpstudio.abmusictrainer id=0x00000000) visible user=0 )

Detail:
       at java.lang.Object.wait(Object.java)
       at java.lang.Thread.parkFor$(Thread.java:1220)
       at sun.misc.Unsafe.park(Unsafe.java:299)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2013)
       at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:510)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.performOperation(DependencyPriorityBlockingQueue.java:197)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.get(DependencyPriorityBlockingQueue.java:236)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:65)
       at io.fabric.sdk.android.services.concurrency.DependencyPriorityBlockingQueue.take(DependencyPriorityBlockingQueue.java:46)
       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1036)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1098)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       at java.lang.Thread.run(Thread.java:818)
 
Upvote 0

FrancisDu09

Member
Licensed User
Here is a part of the code.
Notif is in a service called 'Background'

Note that it happens only on Samsung note 4 / Android 6 !

Service 'Background':
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    ...
    Public notif As Notification
    Private NotifIcon24 As Bitmap
    Private NotifIcon256 As Bitmap
    Private PlayIcon,PauseIcon,PrevIcon,NextIcon,ForwardIcon,RewindIcon As Bitmap
    Public IconeNotifPlay As Boolean
    ...
End Sub

Sub Service_Create
    ...
    ' Lecture des icones notif
    NotifIcon24 = LoadBitmap(File.DirAssets,"icon24.png")
    NotifIcon256 = LoadBitmap(File.DirAssets,"icon256.png")
    
    'PlayPauseIcon = LoadBitmap(File.DirAssets,"ico_playpause.png")
    PlayIcon = LoadBitmap(File.DirAssets,"ico_play.png")
    PauseIcon = LoadBitmap(File.DirAssets,"ico_pause.png")
    PrevIcon = LoadBitmap(File.DirAssets,"ico_prev.png")
    NextIcon = LoadBitmap(File.DirAssets,"ico_next.png")
    ForwardIcon = LoadBitmap(File.DirAssets,"ico_forward.png")
    RewindIcon = LoadBitmap(File.DirAssets,"ico_rewind.png")

    ConstruitNotif
    ...
    Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER
    ...
End Sub

Sub Service_Start (StartingIntent As Intent)
    Service.StartForeground(1,notif)
End Sub

public Sub ConstruitNotif
    ' Construction en fonction du contexte
    Private n As NB6
    Private LibNotif As String = ""
    n.Initialize("default", Application.LabelName,"DEFAULT")
    n.SmallIcon(NotifIcon24)
    n.LargeIcon(NotifIcon256)
    n.OldNotificationIcon("icon")   
    n.Visibility("PUBLIC")
    n.SetDefaults(False,False,False)
    n.OnlyAlertOnce(True)
    n.DeleteAction(Notifs,"ActionDelete")
    If Starter.Player.FichierActif Then
        n.AddButtonAction(PrevIcon,"|<", Notifs,"ActionPrev")
        n.AddButtonAction(RewindIcon,"<<", Notifs,"ActionRewind")
        If Starter.Player.IsPlaying Then
            n.AddButtonAction(PauseIcon,"||", Notifs,"ActionPlayPause")
            IconeNotifPlay = False
        Else
            n.AddButtonAction(PlayIcon,"|>", Notifs,"ActionPlayPause")
            IconeNotifPlay = True
        End If
        n.AddButtonAction(ForwardIcon,">>", Notifs,"ActionForward")
        n.AddButtonAction(NextIcon,">|", Notifs,"ActionNext")
        n.MediaStyle(5)
        LibNotif = Starter.Player.NomFichier
    Else
        ' Pas de lecture en cours
        LibNotif = c.string_Main_LibNotif
    End If
    LibNotif = c.string_Main_LibNotif
    notif = n.Build(LibNotif,"","tag",Main)
End Sub

' This sub is called many times to update notif bar accordinf to context
public Sub MajNotificationBar
    ' Construction en fonction du contexte
    ConstruitNotif
    ' Affichage
    notif.Notify(1)
End Sub
 
Upvote 0

FrancisDu09

Member
Licensed User
So, i am going to verify if last startup as completed and then disable that kind of notification on next launches.
Thank you for your help.
 
Upvote 0
Top