Error messages when upgrading to Android SDK 3.8.0

A few customers have noticed error messages when upgrading from a previous version of the SDK to the latest 3.8.0 SDK.

Failed to validate job

If you see errors like this:

  • MceJobManager: Failed to validate job co.acoustic.mobile.push.sdk.events.EventsJob
  • MceJobManager: Failed to validate job co.acoustic.mobile.push.sdk.location.LocationSyncJob
  • MceJobManager: Failed to validate job co.acoustic.mobile.push.sdk.location.LocationRetrieveJob

You can work around them by adding the following method and calling upgradeJobRegistry before the SDK starts:

import android.util.Log;
import org.json.JSONObject;
import java.util.Iterator;
import co.acoustic.mobile.push.sdk.Preferences;

private void upgradeJobRegistry(Context context) {
    try {
        JSONObject registry = new JSONObject(Preferences.getString(context, "mceJobRegistry", "{}"));
        Iterator keys = registry.keys();
        while(keys.hasNext()) {
            String key = keys.next();
            String updatedKey = key.replace("com.ibm.mce", "co.acoustic.mobile.push");
            JSONObject entry = registry.getJSONObject(key);
            registry.remove(key);
            registry.put(updatedKey, entry);
        }
        Preferences.setString(context, "mceJobRegistry", registry.toString());
    } catch (Exception e) {
        Log.e("RegUpgrade", "Failed to update job registry", e);
    }
}

Failed to create result access

Some customers have also noticed this error message in their logs:

DatabaseHelper: Failed to create result access co.acoustic.mobile.push.sdk.location.cognitive.OperationResult$Access
java.lang.NoSuchMethodException: co.acoustic.mobile.push.sdk.location.cognitive.OperationResult$Access. [class co.acoustic.mobile.push.sdk.util.db.DatabaseHelper, class co.acoustic.mobile.push.sdk.util.db.Database$RowTemplate]
at java.lang.Class.getConstructor0(Class.java:2328)
at java.lang.Class.getConstructor(Class.java:1725)
at co.acoustic.mobile.push.sdk.util.db.DatabaseHelper.getResultAccess(DatabaseHelper.java:127)

This error message is a cosmetic issue which can be ignored safely. It has no effect on SDK performance. It will be fixed in a future release.