gpt4 book ai didi

java - 没有虚方法 getTable()Lio/realm/internal/TableOrView

转载 作者:搜寻专家 更新时间:2023-11-01 09:39:47 24 4
gpt4 key购买 nike

我使用的是 Realm 2.0.2,但出现了这个错误。我自定义了 RealmBasedRecyclerViewAdapter。任何的想法 ?

11-09 15:45:11.122 9877-9877/com.codi6.proyect E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.codi6.proyect, PID: 9877
java.lang.NoSuchMethodError: No virtual method getTable()Lio/realm/internal/TableOrView; in class Lio/realm/RealmResults; or its super classes (declaration of 'io.realm.RealmResults' appears in /data/data/com.codi6.proyect/files/instant-run/dex/slice-io.realm-realm-android-library-2.1.1_ff7f4a8f1f4f385bcd3dc4aabb40b1b4ad26ff2c-classes.dex)
at io.realm.RealmBasedRecyclerViewAdapter.<init>(RealmBasedRecyclerViewAdapter.java:167)
at io.realm.RealmBasedRecyclerViewAdapter.<init>(RealmBasedRecyclerViewAdapter.java:133)
at io.realm.RealmBasedRecyclerViewAdapter.<init>(RealmBasedRecyclerViewAdapter.java:123)
at com.codi6.proyect.adapters.TaskRealmAdapter.<init>(TaskRealmAdapter.java:0)
at com.codi6.proyect.activity.MainActivity1.onCreate(MainActivity1.java:88)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

最佳答案

ThorbenPrimke library RealmBasedRecyclerViewAdapter ('com.github.thorbenprimke:realm-recyclerview:0.9.23') 仅更新至 Realm 1.1.0。

它没有更新到 Realm 2.x。

该库还依赖于不再存在的包内部逻辑。

解决方案:不要使用该库,或将 Realm 版本恢复为 1.1.1。


但是您可以使用 Realm-Android-AdaptersRealmRecyclerViewAdapter, 1.3.0

关于java - 没有虚方法 getTable()Lio/realm/internal/TableOrView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40509873/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com