Mapbox-gl-native: Android x86 does not run

Created on 24 Oct 2015  路  14Comments  路  Source: mapbox/mapbox-gl-native

Tried loading up an x86 build in the emulator.

Got this crash:
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.mapbox.mapboxgl.testapp-1/lib/x86/libmapbox-gl.so: has text relocations

I should go and retest the other ABIs too.

Android bug crash

Most helpful comment

Thanks to this thread I was able to resolve a similar issue in other project. I just wanted to let you know that the actual flag is no-asm instead of -no-asm, at least according to the documentation. Maybe this is useful to other readers.

All 14 comments

note to self: http://b/20013628 was the internal bug this work was done under, and there's more information there about the bad NDK version that caused otherwise innocent apps to get this. folks who really do have assembler with text relocations are presumably hairy enough to look after themselves.

because once I got rid of the text relocations in my library, my random explosions on x86 emulators seemed to be fixed.

Could be related to OkHTTP crash.

Running readelf -a libuv.a | grep TEXTREL against the mason modules did not find anything. Now going to check core GL .a

@kkaefer What would be the easiest way to add a readelf -a libmapbox-gl.so | grep -qv TEXTREL check to the build system so we can catch this in the future. It should fail the build if TEXTREL matches (I added -v flag to invert the return code, 0 = no match, 1 = match)

Interesting ld has a --warn-shared-textrel option.

Must be OpenSSL

leith@leith-xps:~/mb/mapbox-gl-native/build/android-x86/Release/lib.target$ scanelf -qT libmapbox-gl.so 
  libmapbox-gl.so: .LCPI415_0 [0x561940] in (optimized out: previous CAST_encrypt) [0x561900]
...

Im testing the --with-pic flag.

I discovered setting the OpenSSL configure -no-asm flag fixes the TEXTREL problem.

I will update Android to use latest OpenSSL and CURL at the same time.

I will also add the linker error that checks for TEXTREL and will break the build if it finds it.

This issue triggered me to test on Genymotion images:

  • Google Nexus 4: 4.1.1

    • java.lang.UnsatisfiedLinkError: Couldn't load mapbox-gl: findLibrary returned null

Using commit e3517641d85f10d39908348b2fa94bdce803760e

Seeing some other behaviour on the 5.+ Genymotion images:

  • First time installing

    • seeing app running message but nothing happens

    • can't see the app in list of installed apps

  • Second time



    • screen shot 2015-10-24 at 08 04 03



    • screen shot 2015-10-24 at 08 04 30

@tobrun Are you compiling the x86 binaries?

You have to run make android-lib-x86

@ljbade I was not, I'm now looking at the make file and pieces are falling together.
We should maybe add some extra information to contributor setup?

BTW Genymotion paid version has great tools for developing location based apps.
This will make development and testing location tracking a whole lot easier!

screen shot 2015-10-24 at 08 21 20
:trollface:

Thanks to this thread I was able to resolve a similar issue in other project. I just wanted to let you know that the actual flag is no-asm instead of -no-asm, at least according to the documentation. Maybe this is useful to other readers.

Was this page helpful?
0 / 5 - 0 ratings