小编Ant*_*kov的帖子

proguard导致谷歌播放服务'ActivityRecognitionResult getMostProbableActivity崩溃

我最近发布了一个应用程序到游戏商店,虽然它没有proguard工作得很好,但当我决定使用它时,我遇到了意外的崩溃.

我在这里寻找谷歌播放服务推荐的proguard规则,我也试过为这种情况添加另一行.这是我得到的(第三行是我的应用程序):

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}
-keep class * implements com.google.android.gms.internal.ae
-keep class * extends il.co.kix.minitasker.EntityBase
Run Code Online (Sandbox Code Playgroud)

这是回溯后的崩溃报告

android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.google.android.gms.location.ActivityRecognitionResult
at android.os.Parcel.readParcelable(Parcel.java:2086)
at android.os.Parcel.readValue(Parcel.java:1965)
at android.os.Parcel.readMapInternal(Parcel.java:2226)
at android.os.Bundle.unparcel(Bundle.java:223)
at android.os.Bundle.containsKey(Bundle.java:271)
at android.content.Intent.hasExtra(Intent.java:4116)
at com.google.android.gms.location.ActivityRecognitionResult.boolean hasResult(android.content.Intent)(Unknown Source)
                                                             com.google.android.gms.location.DetectedActivity getMostProbableActivity()
at il.co.kix.minitasker.ActivityRecognitionIntentService.void onHandleIntent(android.content.Intent)(Unknown Source)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
Run Code Online (Sandbox Code Playgroud)

令人讨厌的代码行可能是:

...
   @Override
    protected void onHandleIntent(Intent intent) {
        if (ActivityRecognitionResult.hasResult(intent)) {
            ActivityRecognitionResult result …
Run Code Online (Sandbox Code Playgroud)

android proguard google-play-services

4
推荐指数
1
解决办法
2323
查看次数

标签 统计

android ×1

google-play-services ×1

proguard ×1