Search code examples
androidkotlingroovyandroid-gradle-plugingradle-kotlin-dsl

EasyLauncherConfig with name 'debug' not found


I'm using easylaucher library Easylaucher library to add a ribbon on the app icon. I'm using kotlin DSL but when I apply the easy laucher configurations it throws EasyLauncherConfig with name 'debug' not found. Here is my configuration

plugins {
    id("kotlin-android")
    id(BuildPlugins.androidApplication)
    id("com.starter.easylauncher") version "5.1.2"
}
android {
   //...
}

dependencies {
   //...
}

easylauncher {
    buildTypes{
        getByName("debug") {
            filters(
                customRibbon(label = "Debug", ribbonColor = "#FF0000")
            )
        }
        getByName("release") {
            filters(
                customRibbon(label = "BETA", ribbonColor = "#F18357")
            )
        }

    }
}

Anyone with a good solution to this?


Solution

  • I found the solution. Instead of using getByName(...) I used register(...)

    easylauncher {
        buildTypes{
            register("debug") {
                filters(
                    customRibbon(label = "Debug", ribbonColor = "#FF0000")
                )
            }
            register("release") {
                filters(
                    customRibbon(label = "BETA", ribbonColor = "#F18357")
                )
            }
    
        }
    }