How to import Room Persistence Library to an Android project

后端 未结 13 1242
执笔经年
执笔经年 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:13

    This works with the latest version of Android Studio 3.1.

    Under Gradle Scripts folder, in the Project build.gradle, add:

    allprojects {
        repositories {
    
    ...
    
            maven { url 'https://maven.google.com' }
        }
    }
    

    In the Module build.gradle, add:

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

    Source: https://developer.android.com/topic/libraries/architecture/adding-components.html

提交回复
热议问题