On application launch, app starts the service that should to do some network task. After targeting API level 26, my application fails to start service on Android 8.0 on back
To improve the user experience, Android 8.0 (API level 26) imposes limitations on what apps can do while running in the background.
Still if you need always running service, then you can use foreground service.
Background Service Limitations: While an app is idle, there are limits to its use of background services. This does not apply to foreground services, which are more noticeable to the user.
So you can make a foreground service. You will need to show a notification to user when your service is running. See this answer (There are many others)
A solution if -
You can make periodic task, 1. it starts your service, 2. service will do its work and 3. stops itself. By this your app will not be considered battery draining.
You can use periodic task with Alarm Manager, Job Scheduler, Evernote-Jobs or Work Manager.
I have tested forever running service with Work-Manager.