How to import Room Persistence Library to an Android project

后端 未结 13 1192
执笔经年
执笔经年 2021-02-05 00:01

I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the official documentation and I

13条回答
  •  误落风尘
    2021-02-05 00:18

    Open the build.gradle file for your project (not the ones for your app or module) and add:

    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    

    Open the build.gradle file for your app or module and add the artifacts that you need as dependencies:

    dependencies {
    
        implementation "android.arch.persistence.room:runtime:1.0.0"
        annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
    
    }
    

    Reference: Android Adding Components

提交回复
热议问题