Questions tagged [kotlin-gradle-plugin]
38 questions
                    
                    25
                    
            votes
                
                4 answers
            
        We recommend using a newer Android Gradle plugin to use compileSdk = 33
Hey guys how can I update to latest version because I cannot find the latest gradle-plugin. Can somone guide me on this?
build.gradle(ExampleApp)
buildscript {
    ext {
        kotlin_version = '1.6.10'
        kotlin_serializtion_version =…
         
    
    
        Kotlin Learner
        
- 3,995
- 6
- 47
- 127
                    18
                    
            votes
                
                6 answers
            
        Cannot access 'android.arch.lifecycle.LifecycleOwner' which is a supertype of 'com.ex.app.MainActivity'
I create a new flutter project in android studio then "open project" the android part of it, I met
 an error in MainActivity.kt however it builds successfully. 
My class pathes are:
and finally my dependencies are:
implementation…
         
    
    
        Parisa Baastani
        
- 1,713
- 14
- 31
                    14
                    
            votes
                
                1 answer
            
        How does kotlin-gradle-plugin use 'kotlin.code.style' property?
The official Kotlin documentation states:
Add kotlin.code.style=official property to the gradle.properties file at the project root.
I'm trying to understand how kotlin-gradle-plugin handles this property.
Which gradle task uses it?
When running…
         
    
    
        Manu D.
        
- 357
- 3
- 8
                    13
                    
            votes
                
                2 answers
            
        Cannot find method - Error when upgrading kotlin-gradle-plugin from 1.6.21 to 1.7.10
I am getting the following error,
Unable to find method ''org.gradle.api.tasks.SourceTask org.jetbrains.kotlin.gradle.tasks.KotlinCompile.source(java.lang.Object[])''
'org.gradle.api.tasks.SourceTask…
         
    
    
        Willey Hute
        
- 939
- 13
- 18
                    11
                    
            votes
                
                0 answers
            
        How to test kotlin function declared `internal` from within tests when java-test-fixtures module is in use
I've tried to make use of test fixtures in my project in kotlin. Unfortunately I have encountered a strange problem, probably a bug, in a component of the toolchain (not sure which one).
Normally a Kotlin function in main declared internal can be…
         
    
    
        user3159253
        
- 16,836
- 3
- 30
- 56
                    9
                    
            votes
                
                2 answers
            
        Configure Kotlin extension for Gradle subprojects
I'm setting up a multi-module Gradle project based on Kotlin for the JVM. Since the root project does not contain any code, the Kotlin plugin should only be applied to subprojects.
build.gradle.kts (root project)
plugins {
    kotlin("jvm") version…
         
    
    
        ooy10478
        
- 93
- 1
- 4
                    5
                    
            votes
                
                1 answer
            
        Use Kotlin plugins from buildSrc
How can I apply the Kotlin plugins from a buildSrc plugin?
I have a Kotlin project with a build.gradle.kts file containing this:
plugins {
    application
    kotlin("jvm")
    kotlin("plugin.serialization")
}
I want to create a custom plugin in…
         
    
    
        Jordi
        
- 2,055
- 1
- 16
- 34
                    4
                    
            votes
                
                1 answer
            
        (KotlinSourceSet with name 'androidMain' not found.) How can I add android as a build target to a Kotlin Multiplatform project
I am trying to add android() as a build target to a Kotlin Multiplatform library so that I can add a specific library for the android target. All the other targets (jvm, linux, ios) work fine, but android seems to have issues, because the…
         
    
    
        GD21
        
- 223
- 2
- 10
                    3
                    
            votes
                
                1 answer
            
        Difference between Kotlin plugins
What are the difference between this three Kotlin plugin and what they actually do?
plugins {
    id 'kotlin-android'
    id 'org.jetbrains.kotlin.android'
    id "org.jetbrains.kotlin.jvm" version "1.6.20"
}
The third one seems to be the…
         
    
    
        Bitwise DEVS
        
- 2,858
- 4
- 24
- 67
                    2
                    
            votes
                
                4 answers
            
        We recommend using a newer Android Gradle plugin to use compileSdk = 34?
Hey guys how can I update to latest version because I cannot find the latest gradle-plugin. Can somone guide me on this?
build.gradle(:app)
plugins {
    id "com.android.application"
    id "org.jetbrains.kotlin.android"
}
android {
    namespace…
         
    
    
        Kotlin Learner
        
- 3,995
- 6
- 47
- 127
                    2
                    
            votes
                
                1 answer
            
        What's the difference between 「Kotlin Plugin Version」 and 「Kotlin Gradle Plugin Version」?
What's the difference between 「Kotlin Plugin Version」 and 「Kotlin Gradle Plugin Version」?
・Kotlin Plugin Version
The version of KotlinPlugin that can be found at [File]->[Settings]->[Plugins]
・Kotlin Gradle Plugin Version
The version of…
         
    
    
        user13986631
        
- 45
- 4
                    2
                    
            votes
                
                1 answer
            
        How can I apply a plugin to itself using Kotlin DSL?
We have an existing plugin project which configures various things (including static analysis), where we want to apply the plugin to the project itself.
The way this currently works for plugins written in Java is, you add the Java src dir to the…
         
    
    
        Hakanai
        
- 12,010
- 10
- 62
- 132
                    2
                    
            votes
                
                1 answer
            
        java.lang.IncompatibleClassChangeError,After Upgrade kotlin gradle plugin to 1.5.20
I want upgrade kotlin gradle plugin from 1.4.32 to 1.5.20,but some code occurred error in lower android version device,such as Xiaomi 5.1.1 & Oppo 6.0.1 & Pixel2 6.0, but it normal in Android 10 devices.
The error…
         
    
    
        Muse
        
- 422
- 3
- 7
                    2
                    
            votes
                
                1 answer
            
        How to import KotlinMultiplatformExtension inside buildSrc module?
I am developing a kotlin multiplatform project, which has a bunch of modules.
I have written an extension function which is meant to be used inside each module. The extension function extends functionality of KotlinMultiplatformExtension class. Now…
         
    
    
        RadekJ
        
- 2,835
- 1
- 19
- 25
                    2
                    
            votes
                
                2 answers
            
        Apply local jar-plugin without using maven
I'd like to load my custom plugin from a local jar. The jar file compiles fine and when I check it, the manifest and the plugin class are there.
gradlePlugin {
    plugins {
        create("asdf") { // <-- I really call it "asdf" in the kts script
 …
         
    
    
        t3chb0t
        
- 16,340
- 13
- 78
- 118