I tried to build the android-project from SDL2 source code using the Android Studio on Linux, but it fails to build with NDK 21.1.6352462. I get the following error message:
Executing tasks: [:app:assembleDebug] in project /home/tommi/SDL2/2/SDL2-2.0.14/android-project
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :app:checkDebugAarMetadata
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:javaPreCompileDebug
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :app:mergeDebugResources
> Task :app:generateJsonModelDebug FAILED
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:651: Android NDK: Module main depends on undefined modules: SDL2
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop.
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:651: Android NDK: Module main depends on undefined modules: SDL2
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop.
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:651: Android NDK: Module main depends on undefined modules: SDL2
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop.
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:651: Android NDK: Module main depends on undefined modules: SDL2
/home/tommi/Android/Sdk/ndk/21.1.6352462/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop.
> Task :app:processDebugManifestForPackage
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:generateJsonModelDebug'.
> executing external native build for ndkBuild /home/tommi/SDL2/2/SDL2-2.0.14/android-project/app/jni/Android.mk
What is the solution to this problem?