android.gms.maps中的BadParcelableException在发布时但不在调试模式下

时间:2013-08-08 19:32:36

标签: android google-maps proguard badparcelableexception

访问使用Google地图(v.2)的活动时,我的应用会崩溃。我得到了android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.google.android.gms.maps.f

这仅在发布模式下发生,但在我处于调试模式时,日志中没有错误或警告。

我在Eclipse IDE上使用Proguard来混淆代码,所以我想这可能是问题所在。我已经搜索过了,但我还没有找到可能的解决方案

1 个答案:

答案 0 :(得分:1)

尝试使用Google Maps Android API v2示例中的proguard.cfg

它位于ANDROID_SDK/extras/google/google_play_services/samples/maps

这部分是你想要包括的内容:

# The maps library uses custom Parcelables.  Use this rule (which is slightly
# broader than the standard recommended one) to avoid obfuscating them.
-keepclassmembers class * implements android.os.Parcelable {
    static *** CREATOR;
}

但也许其他。

相关问题