Questions tagged [gradle-kotlin-dsl]

Kotlin language support for Gradle build scripts.

gradle-kotlin-dsl
Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Unable to import Content Negotiation and Serializable imports in kotlin Android Studio

I am creating an app on andoird studio and I need to be able to do JSON serialization.However , I am not able to use imports such as import io.ktor.serialization.kotlinx.json.* import io.ktor.server....
Manal Haroon's user avatar
0 votes
0 answers
23 views

animation error just after adding paging3 dependency

Just after adding Paging 3 dependency in module level build.gradle.kts, I encountered a runtime error with the following message: java.lang.ClassCastException: androidx.compose.animation....
khaled baccour's user avatar
0 votes
0 answers
24 views

How can I combine the artifacts from multiple Configurations?

I have a buildSrc plugin needs to share two types of files (resource files and classpath files) between subprojects. // buildSrc/src/main/kotlin/my-plugin.gradle.kts val MyPluginComponent = Attribute....
aSemy's user avatar
  • 6,499
0 votes
0 answers
25 views

Gradle Kotlin Dsl - How to share utility functions

I wrote this: fun Properties.toStringMap(): Map<String, String> = this.toMap().map { it.key.toString() to it.value.toString() }.toMap() tasks.withType<JavaExec> { systemProperties ...
Kurt's user avatar
  • 443
1 vote
1 answer
41 views

Configure gradle-download-plugin unzip in kotlin

The documentation of the gradle-download-task plugin shows an example of how to download and unzip a file. task downloadZipFile(type: Download) { src 'https://github.com/michel-kraemer/gradle-...
René Link's user avatar
0 votes
1 answer
82 views

Gradle allow insecure protocol in initialization script configured repository

I'm trying to write an initialization script as explained here. So I wrote an init.gradle.kts file and put in the following code import java.net.URI apply<EnterpriseRepositoryPlugin>() class ...
René Link's user avatar
0 votes
2 answers
31 views

What is the right way to share subproject functionality with dependencies?

I'm working on a multimodule gradle (kts) project. Each module is a spring boot kotlin app, that provides Elasticsearch requests and responses, for example: project - module core - module a - module b ...
darth jemico's user avatar
0 votes
0 answers
16 views

Circular dependency when publishing to jitpack

What happened? My project structure looks like this: |--build-logic |--core |--sub-core1 |--sub-core2 |--data |--sub-data1 |--sub-data2 I'm trying to publish both sub-core1 and sub-data1 only....
Firate's user avatar
  • 132
0 votes
0 answers
99 views

Keep com.facebook.react gradle plugin from silently adding project repositories

I'm configuring an existing Android app adding react native support. I already migrated gradle files in the documentation to Kotlin DSL and Versions catalog which is the target configuration required ...
Alejandro Casanova's user avatar
2 votes
1 answer
213 views

Android gradle version 8.2.2 failed to build with Multiple build operations failed

// Project Gradle plugins { id("com.android.application") version "8.1.4" apply false id("com.google.dagger.hilt.android") version "2.48" apply false ...
Ravi Sorathiya's user avatar
0 votes
2 answers
201 views

Gradle Kotlin DSL Files - Separate Config Files

I'm currently in the process of migrating my groovy gradle files to kotlin. I have jacoco and sonarcloud integrated into my application. I have separate groovy gradle files for jacoco and sonar ...
DJ-DOO's user avatar
  • 4,649
0 votes
0 answers
106 views

Renaming Android app Bundle and APK (.aab and .apk) files with app name, version and build type - build.gradle.kts

How To change Android App Bundle/APK name (app.aab/app.apk) to reflect App version, App name and build type in build.gradle.kts Here is the build.gradle.kts, I need to rename apk/aab here android { ...
Alfin's user avatar
  • 167
1 vote
0 answers
70 views

Duplicate class javax.annotation found in modules jetified

Hello for a work project i've implemented a new lib developped by someone in my workspace I integrated his .jar file in my libs folder and tried to implement some code he asked me to but nothing seems ...
alpheonix's user avatar
  • 321
1 vote
1 answer
103 views

Kotlin DSL: Why am I able to get logs in release build from Play Store?

We did not enable logging in release mode yet when we connect a USB cable and run Android Studio, we're able to get logs from release build downloaded from the store. buildTypes { debug { ...
Bitwise DEVS's user avatar
  • 3,028
1 vote
0 answers
128 views

IllegalStateException: The driver used with SQLDelight is asynchronous, so SQLDelight should be configured for asynchronous usage

i am trying out sqldelight on web with the async webworker stuff i am getting weird error messages IllegalStateException: The driver used with SQLDelight is asynchronous, so SQLDelight should be ...
Meet's user avatar
  • 581
0 votes
1 answer
87 views

Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException - Hilt Jetpack Compose Android

I'm facing this issue while adding hilt dependencies in my project, error: [Hilt] Unsupported metadata version. Check that your Kotlin version is >= 1.0: java.lang.IllegalStateException: ...
Alfin's user avatar
  • 167
1 vote
1 answer
27 views

Publish each Android library flavour to it's own repository

I'm trying to publishes diffrent flavours of my library to diffrent repositories. I'm using the maven-publish plugin for this. I have an Android library with multiple flavours flavorDimensions += &...
user2408952's user avatar
  • 2,041
0 votes
1 answer
50 views

Pass arguments through command line to a gradle project without a main file

I am developing a plugin for intellij and I have a gradle.build.kts file. I build the binary using "./gradlew build". I want to pass arguments while building so for example something like &...
Coder shoder's user avatar
0 votes
0 answers
39 views

Incompatible dependencies in android studio

THIS IS MY MAIN CODE package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.net.Network; import android.os.Bundle; import android.util.Log; import android....
Apoorv Bajpai's user avatar
0 votes
2 answers
57 views

generate start script that takes environment variables with gradle

I am using gradle installDist task to prepare the data I need to then copy in the Docker image. Now, I need to integrate openTelemetry agent, so I need to attach it on the command line. To modify the ...
Vincent F's user avatar
  • 6,943
-1 votes
1 answer
44 views

Duplicate class error when using debug and release library in Android

I have a library in which I have debug and main packages like so: debug - Android/implementation/src/debug/kotlin/myclass/DebugClass.kt main - Android/implementation/src/main/java/some/other/folders/...
Paul Sizon's user avatar
0 votes
0 answers
41 views

I'm getting error like "No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir() is applicable for argument types" in androidstudio

FAILURE: Build failed with an exception. Where: Script '/Users/pinalsevwala/Downloads/flutter3.3.9/packages/flutter_tools/gradle/flutter.gradle' line: 920 What went wrong: A problem occurred ...
Kuldeep Uniqual's user avatar
0 votes
1 answer
39 views

Jitpack application built successfully but failed to publish with the error: Directory '/tmp' does not contain a Gradle build

Trying to publish a plugin lib on Jitpack, i'm facing a error printed at the end of log file. All the Gradle tasks were successfully executed, but the 'publishment' exited with the error below. ...
Elias Meireles's user avatar
0 votes
0 answers
197 views

Warning from Google Play Console (This App Bundle contains native code....) (Android / App Bundle file)

This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. I am trying to resolve ...
Viacheslav Khailenko's user avatar
0 votes
0 answers
47 views

Need help on organizing a multi-module in Kotlin dsl Gradle

In my previous multi-module projects, I used to do below for organizing common dependencies and whatnot top level ---------- plugins { // id 'com.android.application' version '7.1.2' apply false // ...
hemen's user avatar
  • 1,490
0 votes
0 answers
35 views

Cannot find custom plugins in maven local repo

I've made a custom plugin and uploaded it to local maven build.gradle.kts plugins { `kotlin-dsl` id("com.vanniktech.maven.publish") version "0.27.0" } group = "org....
Cyber Avater's user avatar
  • 1,925
1 vote
1 answer
131 views

How to set my "java-library" library as a kotlin library in Android Studio

I have added a new module to my project from File > New > New Module > Java or Kotlin Library. I set language as Kotlin and DSL as Kotlin DSL. However, my build.gradle lists project as java-...
rupinderjeet's user avatar
  • 2,828
0 votes
1 answer
59 views

Task spotbugsMain NO-SOURCE

I have gradle 8.5/java 21 and my scripts written on kotlin dsl. I create this gradle.kts import com.github.spotbugs.snom.SpotBugsTask plugins { id("com.github.spotbugs") } spotbugs { ...
AnnKont's user avatar
  • 464
0 votes
1 answer
229 views

What is wrong with my openapi generator gradle setup?

I have a multi-module gradle project set up as follows: root build.gradle.kts: plugins { java kotlin("jvm") version "1.8.10" apply false id("org.openapi.generator&...
Kramer's user avatar
  • 954
1 vote
1 answer
388 views

Multiple build operations failed. Android error

plugins { id("com.android.application") version "8.2.1" apply false id("com.google.dagger.hilt.android") version "2.48" apply false ...
Ravi Sorathiya's user avatar
0 votes
1 answer
67 views

How do I pass default JVM args in a Gradle script while allowing variables to be expanded?

I've got the following in my build.gradle.kts file: plugins { kotlin("jvm") version "1.9.20" application } application { mainClass.set("MainKt") ...
Mirrana's user avatar
  • 1,663
0 votes
1 answer
351 views

How to configure build.gradle.kts file in android programming

I have initiated an android project in kotlin and my gradle file has the .kts extension . I am trying to add room dependency but i have accountered an error . Here is what i've done : implementation(&...
Patrick Renaud's user avatar
0 votes
0 answers
9 views

Autogeneration of versionCode based on time doesn't always work

When I invoke apk generation via Generate signed apk, sometimes seems like the cache is being overused and the versionCode doesn't change. Currently my main build.gradle.kts has the following code: ...
mxkmn's user avatar
  • 303
0 votes
0 answers
29 views

Error in android\build.gradle on Vs code (flutter project)

I am currently building an app on VS code using flutter and firebase frameworks, I am still in the setting up stage and encountering a build.gradle error: > Run with --scan to get full insights. * ...
Samaya's user avatar
  • 3
0 votes
1 answer
75 views

Cannot use Guava library in iOS by Kotlin Multiplatform

I am trying to use Kotlin Multiplatform that targets both Android and iOS. But when running tests with the task "iosSimulatorArm64", these imports showed the error "unsolved reference&...
Andy's user avatar
  • 189
0 votes
0 answers
98 views

How to publish both Android apk and aab with android-gradle-plugin 8.2.0-rc02?

I need to publish both apk and aab to my storage. I use android-gradle-plugin 8.2.0-rc02 and trying to use the following code with kotlin-dsl: plugins { id("com.android.application") ...
Est Stalegaykin's user avatar
2 votes
1 answer
145 views

ERROR: No build artifacts found while publising library to android sdk to jitpack

Library is not getting published in a jetpack and leads to an error when I am trying with kotlin-Dsl. Is there any code I am missing? Repo-Link: https://jitpack.io/#devrath/DroidUtilToolBox/1.4.0 ...
Devrath's user avatar
  • 42.6k
0 votes
1 answer
98 views

Getting a duplicate class found exception in android build.gradle.kts file

I'm trying to add a new dependency for passing safe arguments from one fragment to another but doing so will generate duplicate files. Leading to duplicate file exception, This is my build.gradle.kts ...
Abhishek Tyagi's user avatar
2 votes
1 answer
54 views

How to access custom code generated by Kotlin DSL?

I have created a default Empty Views Activity project in Android Studio with Kotlin as language and Kotlin DSL as build configuration language. Then I appended the following code to the app level ...
sanitizedUser's user avatar
1 vote
1 answer
42 views

no main manifest attribute, in /app.jar / gradle.kts/sprinboot

when i am run docker run myorg/myapp - i got error no main manifest attribute, in /app.jar, i searching the answer in this Can't execute jar- file: "no main manifest attribute" but ...
Rustam Saydam's user avatar
0 votes
0 answers
24 views

red line under R.Id.elemnt in android

the R do exist on my code same as the id's elemnt are correct , idk where's the problem , i've tried clean cache , rebuild project and nothing has chnaged , the problem still persists code didn't ...
aziz Jaberi's user avatar
0 votes
0 answers
77 views

How to configure GeckoView in Kotlin DSL project?

I was following the official mozilla tutorial to setup GeckoView, but I couldn't get it right. The tutorial was using Groovy DSL, so I tried to convert each statement they told me into Kotlin DSL ...
sayang_android's user avatar
0 votes
0 answers
16 views

How do I include VolleyPlus Library in Android studio Project in Kotlin

I am trying to add VolleyPlus library in my android studio project but I still cannot access its classes. I specifically need SimpleMultiPartRequest class of this library. https://github.com/DWorkS/...
Saad Farukh's user avatar
0 votes
1 answer
855 views

Android WebView with Jetpack Compose not rendering Mantine UI (React) components properly

Description I've developed a React website using the Mantine UI framework, and it works seamlessly across various browsers and devices. Now, I'm trying to create an Android app using Jetpack Compose ...
Glubker's user avatar
1 vote
1 answer
176 views

using a common variable in settings.gradle.kts and build.gradle.kts

I'm using Gradle in my JAVA project, and I'm using the same URL in both settings.gradle.kts and build.gradle.kts files. The URL is duplicated in both files and I want to declare it once and use it in ...
nofar mishraki's user avatar
1 vote
0 answers
54 views

Reading input stream from ProcessBuilder pipeline in build.gradle.kts hangs

I've read through a ton of questions here and none of the solution code works. I'm in android studio writing a build.gradle.kts script to get a previous version number and increment it by 1. import ...
toshiomagic's user avatar
  • 1,433
0 votes
4 answers
1k views

Unable to enable ksp for room database when using kotlin DSL build script

Problem: I want to use ksp with room. On adding ksp(libs.androidx.room.compiler) in the module level build.gradle.kts file, I get the following error: Unable to load class 'org.jetbrains.kotlin....
Vikram Baliga's user avatar
0 votes
1 answer
166 views

BOM - SLF4J: No SLF4J providers were found

Here build.gradle.kts dependencies { implementation("org.apache.logging.log4j:log4j-api:2.12.4") implementation("org.apache.logging.log4j:log4j-core:2.12.4") ...
Alexei's user avatar
  • 15.1k
0 votes
1 answer
53 views

exclude - None of the following functions can be called with the arguments supplied

here build.gradle dependencies { implementation(enforcedPlatform("org.springframework.boot:spring-boot-dependencies:3.1.2")) { exclude group: "ch.qos.logback", module: &...
Alexei's user avatar
  • 15.1k
1 vote
3 answers
219 views

multi module app with kotlin kts - error running app in emulator (warning: default scripting plugin is disabled:)

I am facing the error below whenever i try to run my first but big leap into android development and kotlin with a multimodule app similar to Now in Android demo app warning: default scripting plugin ...
sheryf's user avatar
  • 29

1
2
3 4 5
27