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?
Thanks.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With