JEP's Diary

Kotlinx Serialization 본문

카테고리 없음

Kotlinx Serialization

지으니88 2021. 1. 15. 16:27

Kotlinx Serialization 세팅하는 방법이 어렵지 않은데..왜 헤맸지ㅜ

세팅방법 적어놓기

https://github.com/Kotlin/kotlinx.serialization

 

build.gradle(app)

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
    id 'kotlinx-serialization'
}


dependencies {
	// kotlin serialization
    implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1'
}

 

build.gradle

buildscript {
    ext.kotlin_version = "1.4.20"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}