Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore alternatives for Mapbox support on 64-bit devices #3270

Open
lognaturel opened this issue Aug 1, 2019 · 2 comments
Open

Explore alternatives for Mapbox support on 64-bit devices #3270

lognaturel opened this issue Aug 1, 2019 · 2 comments
Labels
help wanted Issues that are well-specified and don't require too much context.

Comments

@lognaturel
Copy link
Member

lognaturel commented Aug 1, 2019

As of 8/1/2019, all app updates with native code need to include 64-bit libs: #2844

With the 64-bit stub, @mmarciniak90 got a crash on a Nexus5X: #3144

I believed that crash was because Android uses the best available lib and once the stub was found, there was no attempt to fall back to the 32-bit lib. However, the error message is "/data/data/org.odk.collect.android/app_lib/libmapbox-gl.so" is 32-bit instead of 64-bit which suggests the actual lib load was attempted.

#3191 added the 64-bit lib. Unfortunately, that makes the APK grow by a few megabytes. This can be a big deal for users in remote areas.

The first question to answer, I think, is whether the 32-bit library could work on all 64-bit devices. I thought that would be the case but Android's docs talk about "devices with 64-bit-only hardware" which sounds to me like somehow those devices would not run 32-bit libraries.

There are a couple of ideas that have been floated that could help:

  • App Bundles. Two big concerns about that:

    • how much maintainer burden does it add?
    • could users still do things like transfer the app over bluetooth in the field. Would things like translations still be packaged in that case? What if a user with a 64-bit device wanted to transfer to a user with a 32-bit device? Would that work but just without Mapbox support?
  • From @zestyping: directly load the Mapbox 32-bit library on 64-bit devices and package the 64-bit stub. He's pointed out that here is where Mapbox does the load and that the system call takes an arbitrary file path.

There may be other ideas. The overall goal would be to minimize APK size while prioritizing a good experience for 32-bit devices since that's what our users mostly have currently and because Mapbox mapping is only a small part of what the app does so 64-bit performance is not critical.

@lognaturel lognaturel added the help wanted Issues that are well-specified and don't require too much context. label Aug 1, 2019
@tronku
Copy link
Contributor

tronku commented Aug 2, 2019

@lognaturel I ran into this closed issue mapbox/mapbox-gl-native#3128
Mapbox have support for 64 bit devices.

@lognaturel
Copy link
Member Author

Thanks for looking into this, @tronku! Collect currently bundles the 64-bit native library provided by Mapbox. However, that adds about 3mb to the app size. Our users work in resource-constrained areas where every megabyte counts. They also tend to favor less-expensive devices so 64-bit ones are not currently very common. The goal here is to avoid all devices having to get native code they don't need.

One approach would be to force 64-bit devices to use the 32-bit library. As far as I know, this is always possible, but the Android documentation suggests otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are well-specified and don't require too much context.
Projects
None yet
Development

No branches or pull requests

2 participants