search

Home  >  Q&A  >  body text

android - fastjson不能解析realm

数据库用realm,所有的类要继承RealmObject,用fastjson不能解析,会报错

 Caused by: java.lang.ClassNotFoundException: Didn't find class "rx.Observable" on path: DexPathList[[zip file "/data/app/com.dituwuyou-1.apk", zip file "/data/data/com.dituwuyou/code_cache/secondary-dexes/com.dituwuyou-1.apk.classes2.zip"],nativeLibraryDirectories=[/data/app-lib/com.dituwuyou-1, /vendor/lib, /data/datalib, /system/lib]]

有没有什么解决办法

怪我咯怪我咯2772 days ago682

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 17:38:36

    The method is to use Gson, and realm has publicly verified that it supports Gson. Or check the official requirements for json section
    https://realm.io/cn/docs/java/latest/#json

    Currently, Realm has strict regulations. Try to follow the regulations to avoid encountering pitfalls.

    I think your mistake may be at this location: https://realm.io/cn/docs/java/latest/#jackson-databind

    This is a jackson error similar to the error you made using fastjson.

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 17:38:36

    The perfect combination of Android fastjson and Realm, but there are pitfalls

    reply
    0
  • Cancelreply