HERE SDK tries to start its MapService
internally when consumers call MapEngine.init()
. Due to Android 8 background execution restrictions, this fails if MapEngine
is to be initialized from a background Service. Is there any way to initialize MapEngine
that doesn't involve the SDK starting a Service internally?
The exception log:
> java.lang.IllegalStateException: Not allowed to start service Intent { act=com.here.android.mpa.service.MapService.v3 cmp=de.newecho.app/com.here.android.mpa.service.MapService (has extras) }: app is in background uid UidRecord{6924417 u0a225 CEM idle change:cached procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1521)
at android.app.ContextImpl.startService(ContextImpl.java:1477)
at android.content.ContextWrapper.startService(ContextWrapper.java:650)
at com.nokia.maps.MapServiceClient.a(SourceFile:77)
at com.nokia.maps.MapsEngine.a(SourceFile:622)
at com.nokia.maps.MapsEngine.a(SourceFile:364)
at com.here.android.mpa.common.MapEngine.init(SourceFile:260)
EDIT:
I have no idea why this got marked as a duplicate. My question is not about how to generally handle background work on Android 8 as in the "duplicated" question. The call to startService()
happens in the HERE SDK internally, so consumers have no means to change that. The question is directed towards HERE devs to clarify whether there is a way to initialize MapEngine in a manner so that the HERE SDK doesn't start a Service internally.