Android应用程序从本地环境运行。在市场上托管并从中下载后,它没有运行在我使用过GSON的模块中

时间:2014-03-18 06:40:30

标签: json gson google-play

嗨,我正在使用GSON库开发一个Android应用程序。如果我可以在本地环境中运行该应用程序,它工作正常。在Android市场上部署后,从市场上下载的应用程序没有在哪个区域集成GSON。

2 个答案:

答案 0 :(得分:3)

您需要将这些行添加到您的proguard中,然后在签署您的应用程序时保留gson类。这将让您前进。

##---------------Begin: proguard configuration for Gson  ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature


# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

##---------------End: proguard configuration for Gson  ----------

答案 1 :(得分:1)

check once comment the prorogard file and host in the server and check its working or not if its working fine problem with progard configurations