I am getting a recurring crash in the developer console for all the users with an Android >= 8.0 (Oreo). It began to happen after upgrading Parse from 1.15.8 to 1.16.3.
Not having much information, I tried to check in the code where the IllegalArgumentException
fires. And it actually makes sense, here is the code of GcmBroadcastReceiver's onReceive()
for Parse 1.16.x release :
@Override
@CallSuper
public void onReceive(Context context, Intent intent) {
PushServiceUtils.runService(context, intent);
}
// In Parse 1.15.8, onReceive was instead calling
// ServiceUtils.runWakefulIntentInService(context, intent, PushService.class);
In PushServiceUtils
:
public static boolean runService(Context context, @NonNull Intent intent) {
if (USE_JOBS) { // USE_JOBS : Android SDK >= 8.0 (Oreo)
return PushServiceApi26.run(context, intent);
} else {
return PushService.run(context, intent);
}
}
Although I managed to find where the bug happens, I have not enough knowledge with Android (and especially push notifications) to understand what's going on. In the Manifest, the relevant lines :
<meta-data
android:name="com.parse.push.gcm_sender_id"
android:value="id:xxxxxxx" />
<service android:name="com.parse.PushService" />
<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="bruce.worker.android" />
</intent-filter>
</receiver>
But still, I can't find what's causing this. Any help would be greatly appreciated !