Unable to start a foreground service using kotlin multiplatform

So i am trying to start a simple foreground service.

So this is my service:

class LocationForegroundService : Service() {

    companion object {
        private const val TRACKING_CHANNEL = "tracking_channel"
        private const val TRACKING_NOTIFICATION_ID = 1

        fun startService(context: Context, message: String) {
            val startIntent = Intent(context, LocationForegroundService::class.java)
            startIntent.putExtra("inputExtra", message)
            ContextCompat.startForegroundService(context, startIntent)

        fun stopService(context: Context) {
            val stopIntent = Intent(context, LocationForegroundService::class.java)

    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {

        val input = intent?.getStringExtra("inputExtra")

        val notificationIntent = Intent(this, RiderManagementActivity::class.java)
        val pendingIntent = PendingIntent.getActivity(

        val notification = NotificationCompat.Builder(this, TRACKING_CHANNEL)

        startForeground(TRACKING_NOTIFICATION_ID, notification)

        return START_STICKY

    private fun createNotificationChannel() {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            val notificationChannel = NotificationChannel(
                "Foreground Location Channel",
            val manager = getSystemService(NotificationManager::class.java)

    override fun onBind(intent: Intent?): IBinder? = null

This is how i initialize

LocationForegroundService.startService(this, "Testing")

I created the permission and the service in the manifest as normal.

but i am getting this error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.quicktendr.mgmt.androidApp, PID: 12693
    android.app.RemoteServiceException: Bad notification for startForeground
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1872)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7050)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

Then I created 2 others projects and tested the same service. 1 android native and the other in kotlin multiplataform like the original, and on the android one worked fine, but the kotlin multiplataform i get the same error.