最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - Put flavors in custom gradle.kts file - Stack Overflow

programmeradmin1浏览0评论

I am able to create flavors for my Android application, however I want to move the code in a custom gradle file. Doing this, it gives me this error: "Unresolved reference: android". Why?

flavor-config.gradle.kts:

android {
    flavorDimensions += "version"
    productFlavors {
        create("remote") {
            dimension = "version"
            isDefault = true
        }

        create("local") {
            dimension = "version"
            versionNameSuffix = ".local"
        }
    }
}

build.gradle.kts:

android {
...
}
apply(from = "flavor-config.gradle.kts")
发布评论

评论列表(0)

  1. 暂无评论