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

时间:2022-09-04 08:02:15

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数据库,但每当我使用realm.executeTransactionAsync()方法时,它将给出编译时错误说:

can not resolve method realm.executeTransactionAsync(Anonymous io.realm.Realm.Transaction)...

无法解析方法realm.executeTransactionAsync(Anonymous io.realm.Realm.Transaction)...

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

1 个解决方案

#1


2  

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

并在您的模型gradle中删除任何Realm编译并添加

apply plugin: 'realm-android'

then execute this command

然后执行此命令

./gradlew clean

#1


2  

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

并在您的模型gradle中删除任何Realm编译并添加

apply plugin: 'realm-android'

then execute this command

然后执行此命令

./gradlew clean