Travis Android build not accepting licenses (again...)

Every time I upgrade my Android version, I’m spending hours on fixing idiotic license issues on my Travis build. This is not the first time and I’m wondering: is there any solution that will fix this problem once and for all?

The latest build issue I have is here:
For the first few packages, it accepts the license and then all of a sudden, it does no longer:

January 16, 2019
Do you accept the license 'android-sdk-license-e6a904e8' [y/n]: 

even though I explicitly added that license to my .travis.yml file:

- 'android-sdk-license-e6a904e8'

I found this on SO: Unfortunately, it does not work either:

Did I call this at the wrong place or in the wrong way? Is the sdkmanager version outdated in my used image and does therefore not support the --licenses argument?

Seriously, I want a solution that does not require hours of debugging every time I upgrade Android and its build tools. I’m sick of it. Please build something - anything! - that fixes this ridiculous issue once and for all. Just by looking through the issues here, there are thousands of developers that are facing the same issue every day, with every update. I truly believe there must be a better option to handle this.