Hey, what is the difference between `id("com.andr...
# gradle
v
Hey, what is the difference between
id("com.android.application")
and
id("com.android.library")
in plugin ? I got this developer doc. I am new in learning gradle stuff. Thanks
r
The main difference is that
application
will build APK/ AAB and
library
will build AAR
But here (top level gradle file) you’re just declaring plugins, you need to apply them in the module gradle files
v
I created a kotlin library in intellij
So it in my
build.gradle.kts
Copy code
plugins {
    kotlin("multiplatform") version "1.6.21"
    id("com.android.application")
}

group = "com.abc"
version = "0.0.1"

repositories {
    google()
    mavenCentral()
}
android {
    compileSdk = 21
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        applicationId = "com.letsgetcheked.kotlinmultiplatform"
        minSdk = 21
        targetSdk = 31
    }
    @Suppress("UnstableApiUsage")
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}
r
Yeah, if it’s a library you shouldn’t use com.android.application
v
if I need to build
aar
I need to add
library
in my plugin
okk
r
You should replace application with library, you can’t use both
v
ok sure I'll replace thay
thank you so much
r
If you make a sample app to test your library that should be another module
v
okkk
r
Good luck
v
I have another doubt, Can you we talk in dm?
120 Views