1

I'm working on a multiplatform game (desktop and Android) and I'm currently working on serialization. I use lift-json. It works great on desktop but on Android it's a nightmare:

By exemple, if I write

case class A(int:Int)

implicit val formats = Serialization.formats(ShortTypeHints(List(classOf[A])))

println(write(A(1)))

On desktop I would have:

{jsonClass: "A",int:1} 

and on Android:

{jsonClass : "A"} 

(I cannot deserialize this since it lacks it members). The reason I suspect is proguard 4.8 that the android version use.

4

1 回答 1

1

proguard 所做的一件事是更改类和成员名称。如果您正在使用任何使用 Java 反射的东西,那么 proguard 可能会搞砸。

如果是这种情况,您必须告诉 Proguard 不要混淆存储 JSON 数据所需的类

于 2012-11-09T19:56:52.780 回答