gpt4 book ai didi

android - 使用新的 Parse 1.7 Android API 的 IllegalStateException

转载 作者:太空狗 更新时间:2023-10-29 16:02:37 25 4
gpt4 key购买 nike

我正在将 Parse SDK 更新到版本 1.7,并在使用方法 ParsePush.subscribeInBackground() 时出现以下崩溃:

10-02 12:56:06.426: E/AndroidRuntime(5441): java.lang.IllegalStateException: In order to use the ParsePush.subscribe or ParsePush.unsubscribe methods you must add the following to your AndroidManifest.xml: 
10-02 12:56:06.426: E/AndroidRuntime(5441): <receiver android:name="com.parse.ParsePushBroadcastReceiver"
10-02 12:56:06.426: E/AndroidRuntime(5441): android:exported="false">
10-02 12:56:06.426: E/AndroidRuntime(5441): <intent-filter>
10-02 12:56:06.426: E/AndroidRuntime(5441): <action android:name="com.parse.push.intent.RECEIVE" />
10-02 12:56:06.426: E/AndroidRuntime(5441): <action android:name="com.parse.push.intent.OPEN" />
10-02 12:56:06.426: E/AndroidRuntime(5441): <action android:name="com.parse.push.intent.DELETE" />
10-02 12:56:06.426: E/AndroidRuntime(5441): </intent-filter>
10-02 12:56:06.426: E/AndroidRuntime(5441): </receiver>
10-02 12:56:06.426: E/AndroidRuntime(5441): (Replace "com.parse.ParsePushBroadcastReceiver" with your own implementation if you choose to extend ParsePushBroadcastReceiver)
10-02 12:56:06.426: E/AndroidRuntime(5441): at com.parse.ParsePush.checkForManifestAndThrowExceptionIfNeeded(ParsePush.java:135)
10-02 12:56:06.426: E/AndroidRuntime(5441): at com.parse.ParsePush.subscribeAsync(ParsePush.java:65)
10-02 12:56:06.426: E/AndroidRuntime(5441): at com.parse.ParsePush.subscribeInBackground(ParsePush.java:79)
10-02 12:56:06.426: E/AndroidRuntime(5441): at com.parse.ParsePush.subscribeInBackground(ParsePush.java:88)

尽管我已经从 Parse guide 复制了上面的代码并在 ma AndroidManifest.xml 中包含所有提到的行。

最佳答案

我刚刚注意到 Parse 指南页面上的崩溃文本和 fragment 文本不同 - 应该是

<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.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.push.intent.RECEIVE" />
<action android:name="com.push.intent.DELETE" />
<action android:name="com.push.intent.OPEN" />
</intent-filter>
</receiver>

(注意 Action 名称中缺少 .parse)。

关于android - 使用新的 Parse 1.7 Android API 的 IllegalStateException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26160171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com