android - Google playstore gson 序列化与本地安装的 gson 序列化不同
问题描述
我有这门课
public class _CtV3 {
private long _ct_id;
private String _ct_eml;
private int _ct_lst;
private int _ct_til;
private String _ct_gid;
private int _ct_ntr;
private int _ct_nle;
private int _ct_nlm;
private String _ct_uui;
public _CtV3(long ct_id, String ct_eml, int ct_lst, int ct_til, String ct_gid, int ct_ntr, int ct_nle, int ct_nlm, String ct_uui) {
this._ct_id = ct_id;
this._ct_eml = ct_eml;
this._ct_lst = ct_lst;
this._ct_til = ct_til;
this._ct_gid = ct_gid;
this._ct_ntr = ct_ntr;
this._ct_nle = ct_nle;
this._ct_nlm = ct_nlm;
this._ct_uui = ct_uui;
}
...
}
在某些时候用 Gson 序列化...
String uuid = UUID.randomUUID().toString();
ctV3 = new _CtV3(0, "", 0, 0, "", 0, -1, 0, uuid);
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
String dec = gson.toJson(ctV3);
Log.d(TAG, dec);
现在的问题。如果我直接从 Android Studio 安装在 Android 手机上,一切正常并返回日志
{"_ct_eml":"","_ct_gid":"","_ct_id":0,"_ct_lst":0,"_ct_nle":-1,"_ct_nlm":0,"_ct_ntr":0,"_ct_til":0,"_ct_uui":"f0438604-a22b-44d3-bb4b-9303a828b0f9"}
如果我从 Google PlayStore 安装在同一部手机上,则返回相同的日志
{"a":0,"b":"","c":0,"d":0,"e":0,"f":-1,"g":0,"h":"19ff09be-07d1-411d-a625-bcf4b574abec"}
这个问题上个月出现了,因为我的最后一次升级是在 9 月初进行的。
解决方案
推荐阅读
- tkinter - 在按钮命令之后,标签配置未按预期工作
- go - 如何覆盖 go 模块中的依赖项?
- mysql - Illuminate\Database\QueryException (23000) SQLSTATE[23000]:完整性约束违规:1048 列 'first_name' 不能为空
- javascript - React 图表,但它看起来很特别
- windows - 我怎么能杀死“abc.exe”的所有任务,除了具有特定PID的任务?
- java - java - 如何将函数作为参数从java传递给kotlin方法?
- python - 如何以特定顺序对第一个字母进行排序,以其他特定顺序对第二个字母进行排序
- r - R 等效于具有内部连接和条件的更新查询
- python - 如何从 csv 数据集中找到唯一的痕迹?
- python-2.7 - 如何使用 matplotlib 表示 x 和 y 轴上的数据