0

I am trying to use AndEngine with Android Studio 2.1 and I am running issues specifically with the NDK stuff. The version of AndEngine I am trying to use is the GLES2-AnchorCenter for reference. I create my project and add AndEngine as a module, then give my project a dependency on my AndEngine module. What I end up with is an issue with native code, specifically in in GLES20Fix.c. I get an error message about openGL ES2.0 specific stuff:

Error:(8) undefined reference to `glVertexAttribPointer'
Error:(12) undefined reference to `glDrawElements'`

I know this topic has come up before and I have read this article on the subject but that's what I was already trying to follow and that uses an older version of Android Studio that has a different import option I do not have in 2.1. I have also checked and the NDK plugin for android studio is installed and my minimum build target is over SDK level 9.

One strange detail: when I tried importing andengine as a library in eclipse it worked okay. I don't want to rely on that because I know eclipse is no longer supported for android developer tools so I want to switch off it to the newest version of Android Studio.

Ryan Cori
  • 460
  • 1
  • 3
  • 11
  • I think for now I am just going to try doing work in eclipse and porting work over to Android Studio once I have it figured out. – Ryan Cori May 03 '16 at 17:53

2 Answers2

0

Can you try adding

ldLibs.addAll(['EGL', 'GLESv2'])

eg. https://github.com/googlesamples/android-ndk/blob/master/Teapot/app/build.gradle

Harkish
  • 2,262
  • 3
  • 22
  • 31
0

I had the same issue. This answer helped me.

I just needed to add the following to build.gradle:

sourceSets {
    main {
        jni.srcDirs = []
        jniLibs.srcDir 'libs'
    }
}

and then rebuild the project.

Community
  • 1
  • 1
ya man
  • 443
  • 1
  • 10
  • 15