This still does not solve the issue when Sentry is initiated from SyncAdapter because SyncService runs on a separate background thread and initializing the Handler with Looper.getMainLooper() still gives the same error.

The easiest fix for this will be to create a new thread and post the message from that thread. Is it mandatory that we use the same thread on which the application is currently running? The following code should work.

HandlerThread thread = new HandlerThread("SentryThread") {};
thread.start();
Runnable runnable = new Runnable() {
	@Override
	public void run() {
		doCaptureEventPost(requestData);
	}
};
Handler h = new Handler(thread.getLooper());
h.post(runnable);