1.在项目根目录 build.gradle 添加如下代码并执行同步操作
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://jitpack.io'

本文介绍了如何将GreenDao数据库框架导入到Android Studio项目中,包括在根目录和app目录的build.gradle文件中添加相关配置,引入依赖,创建实体类,并通过编译自动生成DAO代码。

1745

被折叠的 条评论
为什么被折叠?



