Android SDK level 26?



Due to new Android restrictions on location tracking in background mode (, I have to use context.startForegroundService(...); to start the service that handles background location.

Problem is that Android Studio can’t build:
Error:(229, 22) error: cannot find symbol method startForegroundService(Intent)

I’ve updated cordova android to newest release:

I’ve updated to Android SDK Build Tools 27
I’ve installed Android API 26

I’ve added this to my config.xml:

    <preference name="android-minSdkVersion" value="16" />
    <preference name="android-targetSdkVersion" value="26" />

Any Ideas, how I can get android to build?

Note: I know the code is OK, because I got it to build in the start, and actually made a release with it. But since I’ve called some ionic command that screwed it up… prepare, update, whatever…


I solved this by changing the:


in /platforms/android/ It is a hack because the file is generated - so still waiting for a better solution.


saved my live… thx!