Questions tagged [gradle-kts]
15 questions
16
votes
2 answers
isCoreLibraryDesugaringEnabled not works in gradle kotlin dsl / kts
To enable desugaring in our android-library module we must put this in build.gradle:
android {
compileOptions {
coreLibraryDesugaringEnabled true
}
}
But we have all scripts migrated to gradle kotlin dsl, so the problem occurs in…

Krystian Kaniowski
- 1,959
- 17
- 33
7
votes
2 answers
how to add .aar file to gradle.kts in android studio?
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(files("BudgetLibraryNBB.aar"))

Syed Danish Haider
- 1,334
- 11
- 15
5
votes
0 answers
Gradle Multi-Project Build - How to handle local npm project dependencies
The project is building an Angular application.
I need the App build to use the result of another local project which is a javascript library.
Gradle is used to build both projects with the help of com.github.node-gradle.node node plugin.
The…

Loudsi
- 81
- 1
- 7
5
votes
1 answer
How to access Kotlin DSL extensions from non-build-gradle file?
There are few Kotlin Extensions that come along with org.gradle.kotlin.dsl like
android or publishing etc. Say, for publishing, the extension is defined as below
fun org.gradle.api.Project.`publishing`(configure:…

musooff
- 6,412
- 3
- 36
- 65
5
votes
3 answers
How to exclude (ignore) android build variants in gradle kts
During migration build script from groovy to kotlin I met problem with excluding build variants.
In groovy it's pretty easy:
android {
variantFilter { variant ->
if (variant.name == "lorempisum") {
setIgnore(true)
}
…

Krystian Kaniowski
- 1,959
- 17
- 33
5
votes
1 answer
Android Studio : Project Structure unavailable using Gradle KTS Build Files
Open File-> Project Structure.
Issue: It says "Project Structure is unavailable for projects that use Gradle KTS build files. This project uses Gradle KTS build files which are not fully supported in this version of Android Studio"
I am using the…

pablogeorge
- 233
- 1
- 10
2
votes
1 answer
Use different signature for Gradle product flavour and build type in Android
I have an Android build.gradle.kts with multiple flavours, multiple build types and different signing configs for the combinations, it looks like this:
android {
signingConfigs {
create("lite-release") {
…

Serj
- 119
- 1
- 9
2
votes
1 answer
Unresolved reference: buildFeatures in Android multi module project
Working on a multi-module project, i have the following setup:-
android studio = 4.1.3
AGP = "4.1.3"
kotlin gradle plugin = "1.4.32"
using gradle.kts for all my gradle build files
In my (app) module build.gradle.kts i have enabled…

Jamal S
- 1,649
- 1
- 19
- 24
1
vote
1 answer
e: Could not find "ProjectNameToken" in [...]
I have tackled a weird exception that throws the following when I run the linkDebugFrameworkIosArm64 Gradle task or any architecture variant of it for a KMM module;
e: Could not find "Yekta" in…

Yekta Sarıoğlu
- 1,435
- 2
- 12
- 20
1
vote
0 answers
build.gradle.kts not recognising object as variable
I have a build.gradle.kts and I'd like to store all the versions there as :
plugins {
`java-platform`
}
javaPlatform {
allowDependencies()
}
dependencies {
val version = object {
val androidx = object {
val appCompat =…

StuartDTO
- 783
- 7
- 26
- 72
1
vote
1 answer
Compose Desktop projects: how to include API keys (or other secrets) without committing?
In Compose Desktop projects, how can we manage secret keys without committing?
In Android projects, Gradle has the buildConfigField() and resValue() functions. They will generate a BuildConfig.java during compile time, and we can use the values…

Vishnu Haridas
- 7,355
- 3
- 28
- 43
1
vote
0 answers
How to use jdk.internal package with Gradle?
For example, if I'd like to add an extension on Inet4Address to be able to directly retrieve the underlying 32-bit address as an Int:
import jdk.internal.access.SharedSecrets
val Inet4Address.value
get() =…

Jire
- 9,680
- 14
- 52
- 87
0
votes
0 answers
Gradle KTS - create function android?
I am trying to update an older project,
from:gradle 5.6.4, kotlin 1.3.30, android build tools 3.6.3
to: gradle 7.3.3, kotlin 1.6.21, android build tools 7.2.2.
The project compiles and runs after this update, but Android Studio Chimpmunk (2021.2.1…

Jonas
- 2,096
- 20
- 17
0
votes
1 answer
Is there a way to programmatically distinguish between IntelliJ IDEA and Android Studio
I would like to include different parts of a settings.gradle.kts file depending on whether a project is compiled with IntelliJ IDEA or Android Studio.
For my purposes, I only need to know if the project is compiled with Android Studio or not, as…

Binary Enigma
- 58
- 1
- 8
0
votes
1 answer
Android Studio and Gradle KTS Build Files
Background :
Android Studio version : 3.5.3
Gradle wrapper version : 4.8.
This project uses Gradle KTS build files which are not fully supported. Some functions may be affected.

TooCool
- 10,598
- 15
- 60
- 85