Android build using Gradle + AGP + CMake on Android Studio

I am in the process of migrating the build system for Android platform using Gradle +AGP + CMake. I use Kotlin DSL for the Gradle build script. Reusing the same main CMakeLists.txt for the building of the AAR. I could get it to open and build with AS Arctic Fox, as well as build with Gradle wrapper on CLI. Having said that, it is still work in progress. When it is ready I will submit it as PR. However, I face a few hurdles that I could resolve more easily when:

  1. The minimum SDK is set higher, say 21.
  2. The classes are (re-)written using Kotlin.

So, I want to know whether someone else has already done or attempted this before? Should I just migrate the build system without changing the two above for the easier PR acceptance?

What’s AGP?

CMake + Gradle is already a thing in SDL2 in Android Studio - or at least I am using.

AGP = Android Gradle Plugin. I have gotten to the point that the SDL2 project build cleanly on the latest AS Arctic Fox. I have also decided to take the initiative to start migrating the Java classes to Kotlin. With the working IDE, the migration is fully aided. I am very happy so far with the result.

Note that I am building an SDL2 AAR which is later reusable for other Android app project.