Page 1 of 1

Error building Android version

Posted: Fri Jul 01, 2016 6:56 pm
by bmiller
Hello:

I am trying to build the Android version (ogl-es branch) of Irrlicht on an Ubuntu 14.04 Linux machine with latest updates and a recent version of Android SDK and NDK.

I have done the following so far:

$ svn checkout svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es irrlicht-ogl-es
$ cd irrlicht-ogl-es/source/Irrlicht/Android
$ export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/ndk-bundle:$PATH
$ ndk-build

The NDK build output ends with the following error message:

[arm64-v8a] Compile++ : Irrlicht <= CEGLManager.cpp
jni/../../CEGLManager.cpp: In member function 'virtual bool irr::video::CEGLManager::generateSurface()':
jni/../../CEGLManager.cpp:245:61: error: 'ANativeWindow_setBuffersGeometry' was not declared in this scope
ANativeWindow_setBuffersGeometry(EglWindow, 0, 0, Format);
^
make: *** [obj/local/arm64-v8a/objs/Irrlicht/CEGLManager.o] Error 1

and it does not generate the expected output file in lib/Android

Any ideas ?

Re: Error building Android version

Posted: Sat Jul 02, 2016 1:20 pm
by CuteAlien
Hi,

not sure if it helps, but my .bashrc kinda looks like this:

export ANDROID_HOME=/home/micha/android/adt-bundle-linux-x86_64-20131030/sdk
export ANDROID_NDK=/home/micha/android/android-ndk-r10e
export ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/22.0.1
export PATH=.:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_BUILD_TOOLS:$ANDROID_NDK

Did you set ANDROID_HOME before using it?

Which versions for ndk and sdk do you have installed?

ANativeWindow_setBuffersGeometry is part of the android NDK, so I assume for some reason it doesn't use that header in your case, but not sure why (should give a warning that it doesn't find header then I think...).

Note that I removed your other post. Reason we don't want cross-posting in several threads is that it always turns out to be confusing when the discussion get's split (some people answering here, others there). Also chances of finding help don't really increase by cross-posting - our forum is not that big so I read all new posts anyway and I think so do a few others ;-)

Re: Error building Android version

Posted: Sat Jul 02, 2016 1:29 pm
by CuteAlien
Maybe try the following:
In CEGLManager.cpp add the following after the other includes:

Code: Select all

 
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#include <android/native_activity.h>
#endif
 
or maybe native_window.h would already be sufficient.

Please tell me if that makes a difference. The reason is that I don't really see right now how CEGLManager.cpp includes that file. Thought it works here, so I have to be missing something...

Re: Error building Android version

Posted: Fri Jul 08, 2016 10:44 pm
by bmiller
CuteAlien wrote:Maybe try the following:
In CEGLManager.cpp add the following after the other includes:

Code: Select all

 
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#include <android/native_activity.h>
#endif
 
Thanks! With that change I was able to build the binaries including

irrlicht-ogl-es/source/Irrlicht/Android/obj/local/arm64-v8a/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/armeabi/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/armeabi-v7a/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/mips64/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/mips/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/x86_64/libIrrlicht.a
irrlicht-ogl-es/source/Irrlicht/Android/obj/local/x86/libIrrlicht.a

Re: Error building Android version

Posted: Fri Jul 08, 2016 11:05 pm
by CuteAlien
Ok, thanks for feedback. I've just added those line to svn now.