无法启动接收器com.parse.ParseBroadcastReceiver:java.lang.IllegalArgumentException:上次操作后操作无效

Unable to start receiver com.parse.ParseBroadcastReceiver: java.lang.IllegalArgumentException: Operation is invalid after previous operation

我在我的应用程序中集成了 Parse 用于推送通知。我在许多与解析相关的设备上遇到了很多崩溃。我什至还没有发送任何推送通知。我正在使用解析 sdk 1.8.1。这是堆栈跟踪 -

android.app.ActivityThread.handleReceiver   ActivityThread.java, line 2554
2   android.app.ActivityThread.access00  ActivityThread.java, line 163
3   android.app.ActivityThread$H.handleMessage  ActivityThread.java, line 1333
4   android.os.Handler.dispatchMessage  Handler.java, line 102
5   android.os.Looper.loop  Looper.java, line 157
6   android.app.ActivityThread.main ActivityThread.java, line 5335
7   java.lang.reflect.Method.invokeNative   
8   java.lang.reflect.Method.invoke Method.java, line 515
9   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run  ZygoteInit.java, line 1265
10  com.android.internal.os.ZygoteInit.main ZygoteInit.java, line 1081
11  dalvik.system.NativeStart.main  
Caused by: java.lang.IllegalArgumentException: Operation is invalid after previous operation.
1   com.parse.ParseRemoveOperation.mergeWithPrevious    SourceFile, line 53
2   com.parse.ParseOperationSet.mergeFrom   SourceFile, line 62
3   com.parse.ParseObject.mergeREST SourceFile, line 889
4   com.parse.OfflineStore.then    SourceFile, line 798
5   com.parse.OfflineStore.then
6   a.h.run   SourceFile, line 755
7   a.d$a.execute   SourceFile, line 105
8   a.h.c   SourceFile, line 746
9   a.h.a   SourceFile, line 545
10  a.h.a   SourceFile, line 556
11  a.h.a SourceFile, line 650
12  a.h.then  SourceFile, line 638
13  a.h.run   SourceFile, line 796
14  a.d$a.execute   SourceFile, line 105
15  a.h.d   SourceFile, line 787
16  a.h.b   SourceFile, line 599
17  a.h.b   SourceFile, line 574
18  a.h.c   SourceFile, line 638
19  a.h.c   SourceFile, line 662
20  com.parse.OfflineStore.then  SourceFile, line 795
21  com.parse.OfflineStore.then  SourceFile, line 754
22  a.h.run   SourceFile, line 796
23  a.d$a.execute   SourceFile, line 105
24  a.h.d   SourceFile, line 787
25  a.h.b   SourceFile, line 599
26  a.h.b   SourceFile, line 610
27  a.h.a SourceFile, line 702
28  a.h.then  SourceFile, line 690
29  a.h.run   SourceFile, line 796
30  a.d$a.execute

我正在 Application subclass 中初始化 Parse。我已经在清单 class 中正确注册了它。

<service android:name="com.parse.PushService" />

        <receiver android:name="com.parse.ParsePushBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.parse.push.intent.RECEIVE" />
                <action android:name="com.parse.push.intent.DELETE" />
                <action android:name="com.parse.push.intent.OPEN" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.parse.ParseBroadcastReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="my_app_package" />
            </intent-filter>
        </receiver>

我通过禁用本地数据存储解决了我的问题。我在初始化解析之前调用了这个方法 -

            Parse.enableLocalDatastore(this);
            Parse.initialize(this, "key", "key");
            ParseInstallation.getCurrentInstallation().saveInBackground();

我只需要删除 enableDataStore() 方法调用。不确定为什么会导致此问题。