How to set up AndEngine on Android Studio: No Bullshit Guide

Setting up AndEngine really pissed me off. I spent several days trying to figure it out. Supposedly it was easy to integrate, but apparently I’m really stupid. Anyways, here’s a no BS guide to set this game engine up.

  1. Download AndEngine by running the following two commands:
git clone https://github.com/nicolasgramlich/AndEngine.git andEngine
git clone https://github.com/nicolasgramlich/AndEnginePhysicsBox2DExtension.git andEnginePhysicsBox2DExtension

2. Add AndEngine to your project by going to File -> Project Structure. Click the “+” on the left-hand side and add in your andEnginePhysics2DExtension directory.

3. Download a Native Development Kit (NDK) from here http://developer.android.com/ndk/downloads/index.html

4. Add this to the build.gradle files of both andEngine & andEnginePhysics2DEtenstion.

sourceSets {
main {
jni.srcDirs = []
}
}

5. Open the Application.mk file of your andEnginePhysicsBox2DExtension located in the src/main/jni folder.

Add in the end of the file the following line :

APP_PLATFORM:=android-19

6. Go to the directory src/jni directory of your andEnginePhysicsBox2DExtension project and run the command :

PATH_TO_YOUR_NDK/ndk-build

7. Create a folder called “jniLibs” into your app and the folders containing your *.so inside.

It should look like this.

|--app:
|--|--src:
|--|--|--main
|--|--|--|--jniLibs
|--|--|--|--|--armeabi
|--|--|--|--|--|—andEnginePhysicsBox2DExtension.so
|--|--|--|--|--X86
|--|--|--|--|--|--andEnginePhysicsBox2DExtension.so

Hopefully, AndEngine should be working on Android Studio and now you can make awesome 2D games! Please comment below if this guide needs fixing, but hopefully it cuts out the bullshit of setting up AndEngine on Android Studio.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.