In fact that's more an issue about the geometry because the service can't get it by itself. For example if you pass a view using a global list, get the view in the service, you can work on that view locally inside a service and update the view in the activity while in foreground (I posted something about some years ago).
So here we got an error because referring to a size which the service is unable to retrieve. If we sent the dimensions from the activity to the service, the operation would had worked