简体   繁体   English

为什么在使用realm.executeTransactionAsync()方法时出现编译时错误?

[英]Why I am getting compile time error while using realm.executeTransactionAsync() method?

I am developing an application where I have to use realm database but whenever I am using realm.executeTransactionAsync() method it will give compile time error saying: 我正在开发一个必须使用领域数据库的应用程序,但是每当我使用realm.executeTransactionAsync()方法时,都会出现编译时错误,提示:

can not resolve method realm.executeTransactionAsync(Anonymous io.realm.Realm.Transaction)... 无法解析方法realm.executeTransactionAsync(匿名io.realm.Realm.Transaction)...

在此处输入图片说明

add this to your project gradle 将此添加到您的项目gradle

classpath "io.realm:realm-gradle-plugin:3.5.0"

and delete any Realm compile at your model gradle and add 并删除模型编译时的所有Realm编译并添加

apply plugin: 'realm-android'

then execute this command 然后执行此命令

./gradlew clean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM