Question: I've implemented my sync adapter using the guidelines laid out on the Android Developers website, but I am getting an Error Unparceling Bundlle message when I run the code. The stack trace is as follows:

```
FATAL EXCEPTION: main
java.lang.IllegalArgumentException: error unparceling Bundle at 
android.content.ContentResolver.validateSyncExtrasBundle(ContentResolver.java:1159) at 
android.content.ContentResolver.requestSync(ContentResolver.java:1120)

```

I'm targeting Marshmallow and the minimum SDK is 15. Ideas?

Answer: 
Before you call `build()` on your `SyncRequest` object, put `.setExtras(new Bundle())` so that it looks like this:

```
SyncRequest request = new SyncRequest.Builder()
                .syncPeriodic(syncInterval, flexTime)
                .setSyncAdapter(account, authority)
                .setExtras(new Bundle())
                .build();

```

That got the error fixed for me. Hope it works for you.
It is probably related to the type of data you put into `Bundle`. Note the javadoc of `ContentResolver#requestSync` method - not all types supported:

```
/**
 * Start an asynchronous sync operation. If you want to monitor the progress
 * of the sync you may register a SyncObserver. Only values of the following
 * types may be used in the extras bundle:
 * <ul>
 * <li>Integer</li>
 * <li>Long</li>
 * <li>Boolean</li>
 * <li>Float</li>
 * <li>Double</li>
 * <li>String</li>
 * <li>Account</li>
 * <li>null</li>
 * </ul>
 *
 * @param account which account should be synced
 * @param authority which authority should be synced
 * @param extras any extras to pass to the SyncAdapter.
 */
public static void requestSync(Account account, String authority, Bundle extras) {
    requestSyncAsUser(account, authority, UserHandle.myUserId(), extras);
}

```