Невозможно создать экземпляр получателя com.parse.ParseBroadcastReceiver: java.lang.ClassNotFoundExceptio в API 27 - PullRequest
1 голос
/ 14 июня 2019

У меня проблема с ParseBroadcastReceiver.Все работало нормально, пока мы не перешли к API 27. И теперь мы получаем java.lang.RuntimeException, и приложение вылетает каждый раз, когда переходит в режим сна и после пробуждения устройства.Ниже - мой код.

И в моем классе приложений

public class PopeApp extends Application {

public void onCreate () {

    Parse.enableLocalDatastore(this);

      Parse.initialize(new Parse.Configuration.Builder(this)
        .applicationId(Defines.parseApplicationID)
        .clientKey(Defines.parseClientKey)
        .server(Defines.parseURL)
      .build()
    );
}

}

AndroidManifest.xml

    <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.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" />
            <action android:name="1" />
        </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" />

            <!--              IMPORTANT: Change "com.parse.starter" to match your app's package name. -->
            <category android:name="com.MidCenturyMedia.Shopper.light" />
        </intent-filter>
    </receiver>

1 Ответ

0 голосов
/ 14 июня 2019

А это Stack Trase:

android.app.ActivityThread.handleReceiver(ActivityThread.java:3290)
android.app.ActivityThread.-wrap20(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1715)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6682)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
...