`
xieyunbiao
  • 浏览: 36940 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Android Studio 3.2 Gradle3.2使用Realm出错

阅读更多

Android Studio3.2 Gradle3.2 使用Realm,结果gradle3.2出错了。

正常配置环境

build.gradle(project)

 

   buildscript {
        repositories {
        jcenter()
        }
        dependencies {
        classpath "io.realm:realm-gradle-plugin:3.0.0"
        }
    }

build.gradle(module)

 

 apply plugin: 'realm-android'

报错:

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

 

It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

 

从网上查资料得到解决办法是:

build.gradle(project)

classpath "io.realm:realm-transformer:2.1.1"

build.gradle(module)

 

import io.realm.transformer.RealmTransformer
android.registerTransform(new RealmTransformer())
dependencies {
implementation "io.realm:realm-annotations:2.1.1"
implementation "io.realm:realm-android-library:2.1.1"
annotationProcessor "io.realm:realm-annotations-processor:2.1.1"}

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics