SampleSyncAdapter Breakpoints Not Working

I’m using Eclipse to learn how the SampleSyncAdapter example works. I can’t get my breakpoints to work. I set a breakpoint in multiple locations but none get hit. For example, AuthenticatorActivity.onCreate() never get’s called. Anyone know why?


  • Change button text and action - android development
  • Android Studio can't find library classes after Gradle build
  • google Cloud Messaging Push notification
  • How to tell ProGuard to keep everything in a particular package?
  • What does android:isScrollContainer do?
  • How to change values in the shared preference
  • Related posts:

    How to move and rename a project in android studio?
    Can't drag and drop a simple imageView in android studio
    How to get a contact's facebook id or url from native contacts / content resolver?
    What is CoordinatorLayout?
    Android AsyncTask - avoid multiple instances running
    Proper way to get DisplayMetrics: getResources() or getWindowManager()
  • Add custom layout to ActionBar/Toolbar with no margins
  • How do I eliminate the delay before an LayoutTransition animation
  • Android ListView: Detect if ListView data fits on screen without scrolling
  • How do I find out if the GPS of an Android device is enabled
  • Android – multiple custom versions of the same app
  • Crop Image with face detection in android
  • 5 Solutions collect form web for “SampleSyncAdapter Breakpoints Not Working”

    The SyncAdapter thread of execution occurs in a spawned background process, not in the process of your application itself, which is what you have your java debugger attached to.

    Simple and ugly way: log() is your friend.

    Better way: Start by looking at Debugging a service and find if that needs to be adapted for this case.

    Actually, a sync adapter runs in the process in which it is configured. The documentation suggests setting android:process=”:sync”, but that is only a suggestion. For debugging you can always remove this line.

    For Android Studio + Gradle, you might consider adding a debug version of the manifest in src/debug/. Turns out that the Gradle plugin is unable to merge in just the android:process attribute so you need to define the service and provider in src/release/AndroidManifest.xml and src/debug/AndroidManifest.xml separately so there is no merge conflict.

    I had this problem and the solution was quite simple. As said before, the SyncAdapter runs on a different thread so you need to point the debugger to this thread.
    On Android Studio you add (code below) inside the SyncAdapter class:


    When you’re debugging your app the sync adapter service won’t be running automatically, so you have to start it and then target that process.

    Attach debugger to Android Process (It’s an icon next to the green bug)

    It should work just fine

    Following @Eric Woodruff answer I got this idea that I share for those who want a debugging session in Eclipse exclusively dedicated to the sync adapter:
    1. Switch to DDMS perspective
    2. In the device/emulator process locate :synch (see the picture)
    3. Then click on the green bug button ( Debug the selected process: provided it’s source project is present and opened in the workspace )
    enter image description here

    this works fine for me and give me a more realistic point of view:
    enter image description here


    As given in other answers works great.

    On top of that, if your call to ContentResolver.requestSync(mAccount, AUTHORITY, settingsBundle) has anything wrong with it, your service won’t get called without any errors thrown.
    You need to double check that the Authority string is matching in the manifest and xml, and java code. Also the Account object is created correctly with the right account type and added to the AccountManager using:

    accountManager.addAccountExplicitly(newAccount, null, null)

    (the variable names are named after the official android tutorial here:

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.