我们正在使用 kotlin multiplatform 进行公司的下一个项目。一切正常,直到我尝试为 android 创建一个发布版本以进行 beta 测试。我在发布版本中遇到此错误,而在调试中一切正常。
[NetworkManager] unknown exception: l.a.w: Can't locate argument-less serializer for class a. For generic classes, such as lists, please provide serializer explicitly.
Run Code Online (Sandbox Code Playgroud)
这是项目级 build.gradle
buildscript {
ext.kotlin_version = '1.3.70'
ext.versions = [
"ktor" : "1.3.2",
"serialization" : "0.20.0",
"coroutines" : "1.3.6",
]
repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://dl.google.com/dl/android/maven2' }
maven { url "https://s3-eu-west-1.amazonaws.com/elasticode-sdk/Android/maven/" }
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
classpath …Run Code Online (Sandbox Code Playgroud) android kotlin kotlin-multiplatform kotlinx.serialization kotlinx