Building Android on Windows

I started work on a game engine recently and decided to use SDL 2 because I can get it working on Android a lot easier than Allegro. However not far into the project I realized SDL2 is not my cup of tea and I want to use Allegro instead. The problem is that no matter what I do, I can't seem to get Allegro working on android through windows.

SDL2 simply uses an file and then you can call ndk-build on the file and it will compile your code and you can open the folder in eclipse to make/run the .apk. The instructions are fairly simple and I can compile an Android apk quite easily.

However with Allegro, the instructions involve which doesn't work on windows and I've still had endless problems with it on a unix machine and I haven't successfully been able to run an Allegro game on Android.

So I thought maybe if the developers of Allegro could look at the SDL2 Android build technique and use if for Allegro it would make Allegro a more novice friendly library. I'm fairly certain the techniques are quite similar and it wouldn't be too much work to use the

Or if there is already an existing technique for building Allegro Android on Windows (without cygwin), any advice would be appreciated

Edgar Reynaldo
Thomas Fjellstrom
TrieBr said:

I'm fairly certain the techniques are quite similar and it wouldn't be too much work to use the

It does, for the example project. Using the standalone toolchain makes it easier for you to build your own stuff. but theoretically the standalone toolchain step could be removed.

One reason I picked using the standalone toolchain was allowing allegro's normal cmake setup to be used to build allegro itself. noone wants to maintain more than one build system. it's been tried.

We could also add a new Find*.cmake script that helps us look for the android build tools, rather than depending on the standalone toolchain.


Yeah, that makes sense to use cmake for all building.

If I managed to get allegro built using the standalone toolchain in Linux, then would I be able to use ndk-build on windows to build my actual game? I'm fairly sure the actual linking to the .so files is done at run time (in SDL anyway) so once allegro is built I should be able to do the rest on Windows?

Thomas Fjellstrom

I believe so yes, if you can get allegro built for android, you can just copy the allegro libs into your libs/armeabi* folder. you'll want to copy the include files out of the allegro/build/include folder as well, and point your project at those (you can't just copy out the source include files, some files are generated at build time).


So I gave it another shot using Ubuntu on VirtualBox, and I got allegro compiled. :)

So I continued to follow the instructions and I eventually got an APK which I installed and ran on my device. Unfortunately the app crashed and spit out an error on logcat

Couldn't load allegro-debug from loader dalvik.system.PathClassLoader[dexPath=/data/app/org.,libraryPath=/data/app-lib/]: findLibrary re
turned null

I made a folder called armeabi-v7a in the jni folder (where main.c is) and I put all of the .so files in there (including

Here is my

I'm currently just trying to compile the basic android-project that comes with allegro, the only thing I have added to is the ANDROID_NDK_TOOLCHAIN_ROOT path.

Any help would be much appreciated

I opened up the project in eclipse and debugged it from there instead of using the "android update project" and "ant debug" method and it is working now, but I would still be interested in fixing the other method as well.

Trent Gamblin

Did you change the app name from anywhere? If so you have to run cmake with -DANDROID_APP_NAME=com.example.gamename.

Thread #612687. Printed from