Hi, I have been facing the following error lately ...
# android
s
Hi, I have been facing the following error lately
kotlinx.serialization compiler plugin is not applied to the module, so this annotation would not be processed. Make sure that you've setup your buildscript correctly and re-import project.
Tried searching on stackoverflow but things didn't work out. Also, I have done same type of implemenation in 3 other Android Projects and all are working just fine. Any help in this regard is greatly appreciated. Thank you
Production Application crashes whenever we reach this code or is being used.
i
If this is related to release builds then might be a proguard issue.
s
No, the problem is coming in the debug version itself.
i
Right then, maybe you don't have this in your build.gradle file ? Kotlin :
kotlin("plugin.serialization") version "1.8.0"
Groovy :
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.21'
s
hmmm... So this is the current implementation I have
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript *{*
_extra_._apply_ *{*
set("kotlin_version", "1.9.21")
set("nav_version", "2.7.5")
}
_repositories_ *{*
google()
mavenCentral()
maven *{* setUrl("<https://jitpack.io>") *}*
}
dependencies *{*
val kotlinVersion = _rootProject_._extra_.get("kotlin_version")
_classpath_("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
val navVersion = _rootProject_._extra_.get("nav_version")
_classpath_("androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins *{*
id("com.android.application") _version_ "8.2.0" _apply_ false
id("com.android.library") _version_ "8.2.0" _apply_ false
id("com.google.gms.google-services") _version_ "4.4.0" _apply_ false
id("com.google.devtools.ksp") _version_ "1.9.21-1.0.16" _apply_ false
id("com.google.firebase.firebase-perf") _version_ "1.4.2" _apply_ false
id("com.google.firebase.crashlytics") _version_ "2.9.9" _apply_ false
id("com.google.dagger.hilt.android") _version_ "2.48" _apply_ false
kotlin("jvm") version "1.9.21" apply false
_kotlin_("plugin.serialization") _version_ "1.9.21" _apply_ false
_kotlin_("android") _version_ "1.9.21" _apply_ false
}
While for plugins I have
plugins *{*
id("com.android.application")
id("com.google.gms.google-services")
_kotlin_("android")
id("androidx.navigation.safeargs")
id("dagger.hilt.android.plugin")
id("com.google.firebase.firebase-perf")
id("com.google.devtools.ksp")
id("kotlinx-serialization")
_kotlin_("kapt")
id("com.google.firebase.crashlytics")
}