Android NDK: android-14 is unsupported


#1

I’m setup the SDL2 mobile environmental, install Android Studio 3.4.1.
I follow the guide with https://lazyfoo.net/tutorials/SDL/52_hello_mobile/android_windows/index.php.
When I complete the step '12) If you try to hit Build -> Make Project you’ll get the following error: ',
My build got the follow error:

Build command failed.
Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL2-2.0.9\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL2-2.0.9\android-project\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL2-2.0.9/android-project/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\androidlib\SDL2-2.0.9\android-project\app\build\intermediates\ndkBuild\debug\lib APP_PLATFORM=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: android-14 is unsupported. Using minimum supported version android-16.    
process_begin: CreateProcess(NULL, "", ...) failed.
C:/androidsdk/ndk-bundle/build//../build/core/build-binary.mk:666: Android NDK: Module main depends on undefined modules: SDL2    
C:/androidsdk/ndk-bundle/build//../build/core/build-binary.mk:679: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.

The SDL2 guide not tell me how to fix the error.
I think this is cause a Android Studio version update.
Any one can tell me how to fix this?


#2

You can grab the latest 2.0.10 prerelease snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip


#3

Also, in 2.0.9 you can just search through all files of project for string “android-14” and change it manually to “android-16”. There are 2 or 3 places only.
But it’s important to do it before trying to build because duiring build process it will replicate to hundred of places. Clear project and delete folders “build” and “.externalNativeBuild” in that case manually and try again.


#4

I use the SDL-2.0.10 source code to do the step as the ‘52_hello_mobile’ say.
But when the SDL android project import to Android Studio, there is a lot or error at the beginning.
My Android Studio is new, version is 3.4.1.

The error:
SIMPLE: Build command failed.

SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=x86_64 NDK_ALL_ABIS=x86_64 NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\release\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\release\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\release\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\debug\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\debug\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\release\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=x86_64 NDK_ALL_ABIS=x86_64 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\debug\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File


SIMPLE: Build command failed.


SIMPLE: Error while executing process C:\androidsdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Android.mk NDK_APPLICATION_MK=C:\androidlib\SDL-2.0.9-12768\android-project\app\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/androidlib/SDL-2.0.9-12768/android-project/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\androidlib\SDL-2.0.9-12768\android-project\app\build\intermediates\ndkBuild\debug\lib APP_PLATFORM=android-16 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}


SIMPLE: process_begin: CreateProcess(NULL, "", ...) failed.


ERROR: Android NDK: Module main depends on undefined modules: SDL2    
Open File


ERROR: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)    .  Stop.
Open File

For me, a Android new developer, the Android Studio is too hard to use.
Some old Android developers tell me, the Android Studio is hard for them too.

I found the method to develop with Visual Studio:

I can use Visual Studio make Android project, an run it with Visual Studio debug.
But I don’t know how to use SDL in Visual Studio project.

I think the SDL source code need to port to things, one is jni, two is c++.
If I know what in SDL need to port to jni, and what need port to c++, may be I can use SDL in Visual Studio.


#5

I use the method by ‘aa-dav’.
Modify the ‘android-14’ to ‘android-16’ in file ‘build.gradle’
And I see the error ‘ERROR: Android NDK: Module main depends on undefined modules: SDL2’
It means, I can go next step of the ‘52_hello_mobile’.
Thanks everyone!

I hope to see the Visual Studio guide for Android at future
:slight_smile:


#6

I am not sure you can compile the latest SDL2 sources with android-14
you need:

  • an older SDL2 version
  • an older NDK (r13b I think was working well )

#7

I found this:

There is an sample project on GitHub:

I success build the project, but when I run the project, it has an error, and the app crash stopped.

This is my VS solution:

This is my debug step:



I look at the apk file inside, there is no hidapi.so.
loadlibrary4

Does the SDL2 generate the hidapi.so ?
If yes, how to let the hidapi.so generated for my project?