【发布时间】:2016-03-16 06:18:02
【问题描述】:
我对领域完全陌生。我想在我的 android 项目中使用领域数据库。我通过了官方Realm documentation。我需要在我的 android 项目中设置领域。为此,我将 gradle 依赖添加为
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:0.88.2"
}
}
apply plugin: 'realm-android'
这是他们在文档中给出的。但这对我不起作用。它给出了错误提示Plugin with id 'realm-android' not found。
这是我的 build.gradle 文件
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.db.realmsample"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:0.88.2"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
}
我的配置正确吗?
【问题讨论】: