Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Unable to generate android-arm-v7 libs #3118

Closed
leofarage opened this issue Nov 24, 2015 · 12 comments
Closed

Unable to generate android-arm-v7 libs #3118

leofarage opened this issue Nov 24, 2015 · 12 comments
Labels
Android Mapbox Maps SDK for Android support

Comments

@leofarage
Copy link

Hello,

I'm trying to use the latest stable version of mapbox in Android. The first thing I noticed was that gradle doesn't download the necessary .so file.

Following INSTALL.md (https://github.com/mapbox/mapbox-gl-native/blob/master/INSTALL.md) I was able to generate the x86 lib, but not the arm-v7 one. It accuses a missing header called uv.h.

The error I get when running make android is below:

CXX(target) Release/obj.target/core/src/mbgl/annotation/annotation_manager.o
In file included from ../../src/mbgl/annotation/annotation_manager.cpp:3:
In file included from ../../src/mbgl/style/style.hpp:13:
In file included from ../../src/mbgl/util/worker.hpp:5:
In file included from ../../src/mbgl/util/thread.hpp:10:
In file included from ../../include/mbgl/util/run_loop.hpp:7:
../../include/mbgl/util/uv_detail.hpp:7:10: fatal error: 'uv.h' file not found
#include <uv.h>
         ^
1 error generated.
make[2]: *** [Release/obj.target/core/src/mbgl/annotation/annotation_manager.o] Error 1
make[1]: *** [Makefile/androidapp] Error 2
make: *** [android-lib] Error 2

BTW, I'm running this in a OS X Yosemite (10.10.5). Is anybody else experiencing this?

Thank you

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Nov 25, 2015
@kkaefer
Copy link
Contributor

kkaefer commented Nov 25, 2015

@leofarage I can't reproduce this. What version of the code are you running? Can you post any other output that might be related to installing libraries (they should be installed automatically)?

@leofarage
Copy link
Author

@kkaefer So, I found the apklib file in the https://www.mapbox.com/android-sdk/#eclipse from which I was able to retrieve the .so files needed. So that's out of the way.

I really don't know what I was doing wrong -- I cloned the repository yesterday (11/24/2015 -- branch master) and executed the make android from the terminal and it stops at the error I mentioned in the OP.

Now I'm having troubles using the Map on 64 bits devices -- every time I go into the map screen it throws the following error (I'm using a Galaxy S6 and S6 Edge):

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.whittl.whittl.debug-2/base.apk"],nativeLibraryDirectories=[/data/app/com.whittl.whittl.debug-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libmapbox-gl.so"

Strangely this doesn't happen if I run the https://github.com/mapbox/mapbox-android-demo, but the same crash happens if I try running the TestApp included in this repository.

@kkaefer
Copy link
Contributor

kkaefer commented Feb 25, 2016

@leofarage were you able to solve this error? make android should build the arm-v7 libs by default and auto-download all required libs and compilers.

@tobrun tobrun added this to the android-v4.0.0 milestone Mar 6, 2016
@bleege
Copy link
Contributor

bleege commented Mar 8, 2016

@leofarage Are there any other libraries / dependencies in the application that also have native code in them? Reason being is that Android will only run 1 ABI per app and currently the Mapbox Android SDK does not ship an arm64 binary. We're looking to add it via #3128 .

The reason that the Mapbox Android Demo works fine on your phone is that there are no other libraries in it that have arm64 binaries so the whole app runs on the arm7 ABI.

@bleege bleege removed this from the android-v4.0.0 milestone Mar 8, 2016
@bleege bleege added the support label Mar 8, 2016
@leye0
Copy link

leye0 commented Mar 11, 2016

I get the same error with uv.h being missing. I'm starting from the master branch.

@bleege
Copy link
Contributor

bleege commented Mar 15, 2016

@leye0 This error usually comes about when the Core GL build setup is a bit off. Please see the Installation guide, and specifically the part about Installing Dependencies to make sure that things are setup as needed.

@leye0
Copy link

leye0 commented Mar 15, 2016

Yes, I forgot to RTFM (read the * make) log and skipped some missing tools used by mason. I'm ok now. Out of curiosity: how stable is the master branch?

@bleege
Copy link
Contributor

bleege commented Mar 15, 2016

Glad to hear that things are working for you @leye0! This is a complicated project and you're not the first person (nor likely the last!) to have this happen to them. 😃

Out of curiosity: how stable is the master branch?

Generally speaking it's pretty stable as all development is done in separate branches that are then merged back into master when complete. We produce SNAPSHOT releases nightly directly from master so it's not necessary to build the SDK yourself. Instructions for how to integrate the latest SNAPSHOT are available in the documentation.

That said if you're looking to use the SDK in a Production app I'd recommend the latest of the officially released versions.

@leye0
Copy link

leye0 commented Mar 15, 2016

A last question: I've integrated an Android MapboxGL build in Xamarin and noticed some differences with what I add previously. Ex: I need to get a MapboxMap instance instead of operating directly on the MapView, source code for annotations is factored with generics (which translated to object instead of generics when auto-building the .Net bindings), there are slight differences in namespaces, etc... So I understand that there is a difference between Mapbox Android SDK and Mapbox GL. Also, I see that there is a snapshot for Mapbox Android SDK and not for Mapbox GL.

Is there a huge difference between the two projects? Should I switch right away to Android SDK if I'm using it on Android? Will I get the same amount of features?

@bleege
Copy link
Contributor

bleege commented Mar 22, 2016

@leye0 It's not surprising that you're experiencing a disconnect with Xamarin's wrapper plugin as it's using Mapbox Android 3.2.0 and all the MapboxMap code is part of the Mapbox Android 4.0.0 code base which is still in beta (see #4419). I anticipate that when Mapbox Android 4.0.0 is released Xamarin will update their plugin to incorporate it.

So I understand that there is a difference between Mapbox Android SDK and Mapbox GL.

This is where there can be some confusion, and I want to make sure we're talking about the same thing. 😃 Mapbox GL was the original name of these projects when we started building it, and hence why the GitHub repos have it in in their names. The -native project eventually stopped using the term GL in their names while the -js project continues to do so. To make things more clear here's a list of what SDKs come from what repositories:

Also, I see that there is a snapshot for Mapbox Android SDK and not for Mapbox GL.

I'm assuming that when you say Mapbox GL you're referring to Mapbox GL JS as it sounds like you're building a Hybrid mobile app. In that case then no there is not a SNAPSHOT build like the Mapbox Android SDK produces nightly. It'll require manually building per the instructions on the repo:

https://github.com/mapbox/mapbox-gl-js

Is there a huge difference between the two projects? Should I switch right away to Android SDK if I'm using it on Android? Will I get the same amount of features?

There are differences between the -native and the -js projects as they're two different code bases each with their own timelines and priorities. Which one to use is going to be determined by the needs of the project in terms of features as well as in terms of technology being used. The best guide for determining the differences is going to be comparing the documentation of each:

https://www.mapbox.com/mapbox-gl-js/api/

https://www.mapbox.com/android-sdk/api/

@leofarage
Copy link
Author

@bleege I'm sorry for taking so long to answer. Yes, Card.IO was shipping an arm-64 ABI thus breaking the app.

@bleege
Copy link
Contributor

bleege commented Mar 22, 2016

@leofarage Awesome! Glad to have confirmed that it was the ABI mismatch that was the troublemaker. As you saw in #3128 (comment) we've now got arm64 added. Our first release with it is yesterday's beta.2 so please feel free to give it try to make double sure that everything is working as expected.

@bleege bleege closed this as completed Mar 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android support
Projects
None yet
Development

No branches or pull requests

5 participants