728x90
반응형
Android Studio 에서 Kotlin을 사용하기 위해 build.gradle(Module)에 Kotlin 관련 plugin과 dependencies를 추가했는데 발생하는 에러.
( Plugin [id: 'org.jetbrains.kotlin.android'] was not found in any of the following sources: 관련 에러 )
1. build.gradle(Module) 에 plugins와 dependencies 추가
plugins {
id 'com.gladed.androidgitversion' version '0.4.4'
id 'org.jetbrains.kotlin.android' // 코틀린 plugins
}
dependencies {
implementation 'androidx.core:core-ktx:+'
}
2. build.gradle(Project)에서 kotlin 버전과 classpath 추가
buildscript {
// kotlin 버전
ext {
kotlin_version = '1.8.0'
}
//-----------------------
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // kotlin classpath
}
}
728x90
반응형