



If the application needs to open "52_hello_mobile\hello.bmp", it needs to be at "C:\androidprojects\SDL\app\src\main\assets\52_hello_mobile\hello.bmp" when building. Copy the directory inside of the zip we downloaded and place it in the assetsĭirectory. Create a folder called "assets" at "C:\androidprojects\SDL\app\src\main\assets". This will change the name under the App's icon from "SDL App" to "SDL Tutorial".ġ9) At this point the app will run our code but it will fail because it can't load the media files for the tutorial. 18) Open "C:\androidprojects\SDL\app\src\main\res\values\strings.xml" and change Build again and you should get no errors. To fix this, open up "C:\androidprojects\SDL\app\src\main\jni\Application.mk" and change Is due to the fact that the project is not set up to use the standard C++ library. 17) The errorĮrror:(7, 10) fatal error: 'string' file not found Build and you should get a new error in the gradle build menu. Open up "C:\androidprojects\SDL\app\src\main\jni\src\Android.mk" and change "YourSourceHere.c" to "C:\androidprojects\SDL\app\src\main\jni\src\52_hello_mobile.cpp". YourSourceHere.c is a place holder for our application source file so we need to replace it with ours.ĭownload the source for lesson 52 and place 52_hello_mobile.cpp at It's trying to compile "C:/androidprojects/SDL/app/src/main/jni/src/YourSourceHere.c" but can't find it which In this case, the error "No rule to make target" actually means it can't find the file you're asking to compile. `C:/androidprojects/SDL/app/src/main/jni/src/YourSourceHere.c', needed by `C:/androidprojects/SDL/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/main/YourSourceHere.o'.

Scroll up a bit and you'll see some errors from the ndk-build. Open up the project window, right click on app and select What we need to do is tell gradle (the build tool used by Android Studio) to use the Android make file for our project. SDL2 as a shared object that will interface with Java, and we'll build our game as another shared object that will interface with SDL 2. The Native Development Kit that allows Java to interface with native C/C++ code using the Java Native Interface. Android development is mostly Java based and SDL is a C based library. Let's back up a bit and talk about how SDL 2 on Android works. This is complaining that the NDK setup is broken for our project. > Error: Your project contains C++ files but it is not using a supported native build system.Ĭonsider using CMake or ndk-build integration with the stable Android Gradle plugin: 14) The new error will say:Įrror:Execution failed for task ':app:compileDebugNdk'. Build again and you should get a new error.
