Can't get CPP game to compile or run for android

Can't get CPP game to compile or run for android
0

#1

I created a cocos2d-x game in c++ and published it to the apstore for iOS. I’d like to publish it for android now.

I’m having a hard time to even get it to run or compile in android studio.

I tried via the console “cocos compile -p android --android-studio”

I also tried loading the app directly in android studio.

What is the recommended steps to getting this to work?

These are the errors when running “cocos compile -p android --android-studio”

coyotecannon git:(master) cocos compile -p android --android-studio
Python 2.7.10
Building mode: debug
Using Android Studio project : 
/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio
Building apk...
running: ' 
"/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-
studio/gradlew" --parallel --info assembleDebug -PPROP_NDK_MODE=debug'

Initialized native services in: /Users/marc.renaud/.gradle/native

FAILURE: Build failed with an exception.

*  What went wrong:
Could not determine java version from '9.0.1'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
Error running command, return code: 1.

I tried running it directly through android studio but ran into an infinite number of issues and errors when trying to build.

Here is one of them:
Build command failed.
Error while executing process /Users/marc.renaud/Library/Android/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/Android.mk NDK_APPLICATION_MK=/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-10 NDK_MODULE_PATH=/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d:/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos:/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external -j8 NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: android-10 is unsupported. Using minimum supported version android-14.
rm -f /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/*
rm -f /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdbserver
rm -f /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdb.setup
mkdir -p /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi
echo [armeabi] "Gdbserver ": “[arm-linux-androideabi-4.9] /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdbserver”
install -p /Users/marc.renaud/Library/Android/sdk/ndk-bundle/prebuilt/android-arm/gdbserver/gdbserver /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdbserver
echo [armeabi] "Gdbsetup ": “/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdb.setup”
echo “set solib-search-path /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi” > /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdb.setup
echo “directory /Users/marc.renaud/Library/Android/sdk/ndk-bundle/sysroot /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/…/…/…/Classes /Users/marc.renaud/Documents/cocomake: *** No rule to make target /Users/s2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/./pluginsdkboxads /Users/marc.renaud/Documents/cocos2dx/CoymoteCanarc.renaud/Documents/cocos2dx/CoyoteCannonno/CoyoteCannon/proj.android-studio/app/jnn/CoyoteCannoni/../../../Cla/proj.ssandroes/Helloid-studio/app/jni/./pluginadmob /Users/marc.renaud/WorldScene.cpp', needed by/Users/maDorc.renaud/Docucuments/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debmeug/MyGame_shntared//Users/mars/c.renaud/coDocumcosen2dxts/coc/Cos2dx/CoyoteCannooyoteCn/CoyoteCannon/proj.aannondroid-sn/Ctudio/app/jni//oyot/__eCan/Classes/Hellonon/WorldScenecocos2.o’. d/ Stop.c
ocos/editor-support/cocostudio/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/cocosbuilder/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/3d/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/spine/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/./sdkbox /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/ui/…/editor-support /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/include /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/flatbuffers/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/. /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/GUI/CCControlExtension /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/GUI/CCScrollView /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/Box2D/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/network /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/android-specific/pvmp3dec/src /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/android-specific/pvmp3dec/include /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/. /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./. /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/tinyxml2 /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/unzip /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/chipmunk/include/chipmunk /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/xxhash /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/nslog /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri/common /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri/sweep /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/clipper /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/websockets/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/freetype2/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/freetype2/prebuilt/android/…/…/include/android/freetype2 /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/png/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/jpeg/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/tiff/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/webp/prebuilt/android/…/…/include/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/chipmunk/prebuilt/android/…/…/include /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/zlib/prebuilt/android/…/…/include /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/recast/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/bullet/prebuilt/android/…/…/include /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/bullet/prebuilt/android/…/…/include/bullet /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/platform/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/openssl/prebuilt/android/…/…/include/android /Users/marc.renaud/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures /Users/marc.renaud/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include /Users/marc.renaud/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include /Users/marc.renaud/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/…/platform/android /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/…/…/external/android-specific /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/edtaa3func /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/ConvertUTF /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/platform/android/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/platform/android/…/… /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/cocosbuilder/…/…/2d /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/cocostudio/WidgetReader /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/android-specific/tremolo/Tremolo” >> /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/lib/armeabi/gdb.setup
mkdir -p /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/MyGame_shared//Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/hellocpp
echo [armeabi] “Compile++ thumb”: “MyGame_shared <= main.cpp”
/Users/marc.renaud/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -MMD -MP -MF /Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/armeabi/objs-debug/MyGame_shared//Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/hellocpp/main.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -g -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -O0 -UNDEBUG -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/…/…/…/Classes -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/./pluginsdkboxads -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/./pluginadmob -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/cocostudio/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/cocosbuilder/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/3d/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/editor-support/spine/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/proj.android-studio/app/jni/./sdkbox -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/ui/…/editor-support -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/flatbuffers/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/. -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/GUI/CCControlExtension -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/extensions/GUI/CCScrollView -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/audio/android/…/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/Box2D/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/network -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/android-specific/pvmp3dec/src -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/android-specific/pvmp3dec/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/. -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./. -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/tinyxml2 -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/unzip -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/chipmunk/include/chipmunk -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/xxhash -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/nslog -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri/common -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/poly2tri/sweep -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/cocos/./…/external/clipper -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/websockets/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/freetype2/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/freetype2/prebuilt/android/…/…/include/android/freetype2 -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/png/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/jpeg/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/tiff/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/webp/prebuilt/android/…/…/include/android -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/chipmunk/prebuilt/android/…/…/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/zlib/prebuilt/android/…/…/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/recast/… -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/bullet/prebuilt/android/…/…/include -I/Users/marc.renaud/Documents/cocos2dx/CoyoteCannon/CoyoteCannon/cocos2d/external/bullet/prebuil



Android studio and c++ sources
#2

What version of java are you using?


#3

This is my current version:

java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

#4

Open the Project up in Android Studio and try building it from there. I have found that Android has problems with Java 9. That is why I use Java 8.
see: https://stackoverflow.com/questions/47627499/does-android-studio-3-support-java-9-for-android-development


#5

Same, spent 1 day to get it just compiled. I just created cocos project using cocos new command, set name as for my game. Then opened project in android aka crapdroid(lol really) studio and fixed all errors there… based on stackoverflow answers and some from this forum posts… I would not suggest you to compile using CL…


#6

I decided to try and get a new project. I create the standard cpp hello world project with cocos new with the same name and bundle id as my game.

I finally got that project to compile and run with the following settings:

PROP_COMPILE_SDK_VERSION=16
PROP_MIN_SDK_VERSION=10
PROP_TARGET_SDK_VERSION=16
PROP_APP_PLATFORM=10
PROP_APP_ABI=x86

I created a virtual device with x86 since I could not get anything to work with armeabi

Now I run the app on the virtual device but it crashes as soon as it launches. When I run with debugger I notice it does not even get to the code in the AppDelegate.cpp before crashing.

It’s crashing in the cocos2dx framework when initializing the Renderer class in CCRendere.cpp in Renderer::setupVBOAndVAO()

I’m using the latest NDK I think. Whichever android studio installed.

Here is the stack trace.

<unknown function> 0x0000000000000000
cocos2d::Renderer::setupVBOAndVAO() CCRenderer.cpp:278
cocos2d::Renderer::setupBuffer() CCRenderer.cpp:267
cocos2d::Renderer::initGLView() CCRenderer.cpp:258
cocos2d::Director::setOpenGLView(cocos2d::GLView*) CCDirector.cpp:427
::Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv *, jobject, jint, jint) javaactivity-android.cpp:94

It’s crashing on the first line of that function

void Renderer::setupVBOAndVAO()
{
    //generate vbo and vao for trianglesCommand
    glGenVertexArrays(1, &_buffersVAO);  <---- !!!! CRASHING HERE !!!
    GL::bindVAO(_buffersVAO);
    
    glGenBuffers(2, &_buffersVBO[0]);

    ...
    ...

Does this seam like it’s trying to use a gl function that does not exists? Does this mean it’s an NDK version issue?

If so, how can I install a different NDK version via android studio? Which one should I be using?

Any Ideas?

Thanks again for your help.


#7

Do you have hardware to test on?


#8

To feel less pain just buy some android device, not try to use emulator. However it worked for me for the first time, later after some studio updates it’s stopped. Now I’m running always only on device.

I’m using

PROP_COMPILE_SDK_VERSION=27
PROP_MIN_SDK_VERSION=19
PROP_TARGET_SDK_VERSION=27
PROP_BUILD_TOOLS_VERSION=27.0.3
PROP_APP_ABI=armeabi-v7a

Installed:


Build tools 27, but you can use latest.


#9

I went out and bought an android device instead of trying to get the simulators to work and got the HelloWorld to work.

Thanks for all the information.