Hello everyone !
I've been struggling for several days now to make SDL2 work on android.
I've found a great SDL2 + gradle example: https://github.com/stephen47/android-sdl2-gradle-template
However, it uses an old version of the gradle plugin that doesn't handle CMake, and I need CMake to easily build a big project that already uses it on desktop platforms. Fortunately, the last versions of gradle and android studio base their native builds on CMake and Android makefiles (which I can use to easily build SDL2 for android).
I've managed to create a sample project that builds successfully: https://github.com/pvallet/hello-sdl2-android
But it crashes on execution: the programs receives
SIGSEGV (signal SIGSEGV invalid address (fault address 0x10)) at the end of the function onCreate() in SDLActivity.java. The debugger is set to be able to debug C++, but the execution stops before reaching the first breakpoint in the C++ main function.
Moreover, when building, I get a message saying SDLActivity uses a deprecated API:
Note: /path/to/SDLActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
It makes me wonder, is SDLActivity.java up-to-date with the 2017 versions of android SDK (and gradle ?)
Any help would be much appreciated, I'm pretty much stuck there