Android Question Help in Error starter handleStart

Lucas Siqueira

Active Member
Licensed User
Longtime User
The Play Store console shows the following error for several users:

Problem details

br.com.protocolo.starter.handleStart

java.lang.RuntimeException

Code:
Exception java.lang.RuntimeException:
  at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5277)
  at android.app.ActivityThread.-$$Nest$mhandleServiceArgs (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2558)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loopOnce (Looper.java:232)
  at android.os.Looper.loop (Looper.java:317)
  at android.app.ActivityThread.main (ActivityThread.java:8927)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:681)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:915)
Caused by java.lang.RuntimeException:
  at anywheresoftware.b4a.objects.ServiceHelper$StarterHelper.handleStartIntent (ServiceHelper.java:173)
  at br.com.protocolo.starter.handleStart (starter.java:102)
  at br.com.protocolo.starter.access$000 (starter.java:8)
  at br.com.protocolo.starter$1.run (starter.java:74)
  at anywheresoftware.b4a.objects.ServiceHelper$StarterHelper.onStartCommand (ServiceHelper.java:240)
  at br.com.protocolo.starter.onStartCommand (starter.java:72)
  at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5259)


My code Starter:
B4X:
#Region  Service Attributes 
    #StartAtBoot: False
    #ExcludeFromLibrary: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Service_Create
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.
End Sub

Sub Service_Start (StartingIntent As Intent)
    Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
End Sub

Sub Service_TaskRemoved
    'This event will be raised when the user removes the app from the recent apps list.
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Sub Service_Destroy
End Sub


My code Manifest:
Code:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
'SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.



'Icone adaptativo Inicio ------------------------------------------------------------------
'https://www.b4x.com/android/forum/threads/adaptive-icons-simple-instructions-and-tips.123843/
SetApplicationAttribute(android:icon, "@mipmap/ic_launcher")
CreateResource(mipmap-anydpi-v26, ic_launcher.xml,
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/background"/>
<foreground android:drawable="@mipmap/foreground"/>
</adaptive-icon>
)
'Icone adaptativo Fim ------------------------------------------------------------------


'Delete database--------------------------------------------------------------------------------
' Evita que o banco de dados permaneça no APP depois que ele for desinstalado
'https://developer.android.com/identity/data/autobackup?hl=pt-br
SetApplicationAttribute(android:allowBackup, "false")
'--------------------------------------------------------------------------------


'Set color statusbar and navigatorbar-------------------------------------------------------------------------------
SetApplicationAttribute(android:theme, "@style/LightTheme")

CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">@android:color/transparent</color>
</resources>
)

CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:windowActionBarOverlay">true</item>
    </style>
</resources>
)
'--------------------------------------------------------------------------------


'provider--------------------------------------------------------------------------------
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)
'--------------------------------------------------------------------------------


'camera service--------------------------------------------------------------------------------
SetServiceAttribute(KeepRunningService, android:foregroundServiceType, shortService)
'--------------------------------------------------------------------------------


Libraries in use:
1793363122770.png
 
Back
Top