I've been working for a long long... time attempting to build the most basic project on Android with Mapbox that I can, but so far no luck.
There 2 restrictions on how I build it.
1) Build from source
2) App must be debuggable into C++/C source
I have used the following instructions:
https://github.com/mapbox/mapbox-gl-native/blob/master/INSTALL.md and other web pages linked from here.
These pages don't explain how to create a test app, they only tell you how to build the library. I've already followed those and have built the library. I created an app using:
https://www.mapbox.com/help/first-steps-android-sdk/
but it crashes when I run it inside a C++ library function.
It seems reasonable to believe that the developers of Mapbox must be doing this, but I have no idea how. I can't even build a working example using the Mapbox library source, let alone debug it.
I have found the following document that claims to help in debugging a C/C++ Android app, but either it's not clear or there's not enough information to accomplish debugging a source library using this method.
http://tools.android.com/tech-docs/new-build-system/gradle-experimental
A sample project that does this would be quite helpful. Even one that builds a working (doesn't crash) simple example from source without debugging would move me in the right direction. I'll still need to debug it, but at least I would know how to build a working example from source.
I have asked Mapbox for assistance. They typically respond by asking me questions back like, "Do you need to really build the source?" After I answer a few of their questions, they say they'll get back to me. After a few weeks of not hearing back, I ask if they have an answer to my question and they have no memory of the conversation and loop starts over. They seem too busy to follow though on answering my question.
Any assistance on this simple yet elusive task would be much appreciated.
Thank you.
Mitch
UPDATE:
I can get the project to build now, but still no luck getting it to run or debug. I found a page that looked like it might help:
https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/DISTRIBUTE.md
These instructions don't work and report jni.h file not found. I attempted to correct this by
BUILDTYPE=Debug make apackage -I$JAVA_HOME/include
However, this creates the similar error:
../../include/mbgl/gl/gl.hpp:30:14: fatal error: 'GLES2/gl2.h' file not found
Should I be building from inside Android Studio to get debugging to work or using the command line?
UPDATE:
Also get the error by invoking:
BUILDTYPE=Debug make android-lib-x86-64
but don't get it with:
BUILDTYPE=Debug make android-lib-x86
Also, when I run under Android Studio, the following line crashes:
static {
System.loadLibrary("mapbox-gl");
}
Inside:
mapbox-gl-native/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
Does this imply the instructions from Mapbox is missing the step to put the library into the apk?