레이블이 #android studio인 게시물을 표시합니다. 모든 게시물 표시
레이블이 #android studio인 게시물을 표시합니다. 모든 게시물 표시

2020년 6월 6일 토요일

To use Room in Android, you need more dependencies

When you use Room in Android, set the options below

In build.gradle(Module:app)
------------------------------------------------------------------------------------------
apply plugin: 'kotlin-kapt'

dependencies {
    def room_version = "2.2.3"
    def lifecycle_version = "2.2.0"
    implementation "androidx.room:room-runtime:$room_version"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"

    implementation "android.arch.lifecycle:extensions:$lifecycle_version"
    kapt "android.arch.lifecycle:compiler:$lifecycle_version"
    implementation "android.arch.persistence.room:runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
}

2020년 6월 4일 목요일

When you meet the error 'Failed to resolve: com.github.PhilJay:MPAndroidChart:v3.1.1'

in build.gradle(Project: project name)

buildscript {    ext.kotlin_version = "1.3.72"    repositories {        maven { url 'https://jitpack.io'}
        google()
        jcenter()
    }    dependencies {        classpath "com.android.tools.build:gradle:4.0.0"        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}
allprojects {    repositories {        maven { url 'https://jitpack.io'}
        google()
        jcenter()
    }}


in build.gradle(Module: app)
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"    implementation 'androidx.core:core-ktx:1.3.0'    implementation 'androidx.appcompat:appcompat:1.1.0'    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    testImplementation 'junit:junit:4.13'    androidTestImplementation 'androidx.test.ext:junit:1.1.1'    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'}