I want to use both cmake and ndk-build to build an android application.
I need cmake to run first, then ndk-build and then assemble the .apk file
To do that I have resolved by specifying only cmake in externalNativeBuild and running ndk-build as an Exec task.
I invoke the task with:
beforeEvaluate { assembleRelease.finalizedBy { runNdkBuild } }
Unfortunately this seems that it calls the task after the apk has been assembled so the .so files are not included. If i rerun gradlew then it updates the apk with the so files.
How can I make the task to run before assembling the apk but after cmake so that the generated binaries will be included in the apk?