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

Missing arm64 lib #3128

Closed
Closed

Description

@leofarage

I'm trying to use MapBox's version 2. in my project but when I try to show the Map an UnsatisfiedLinkError is thrown.

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

I saw an open issue that was discussing something related to that -- in the discussion it seemed that Android should fallback to the 32bit lib if no 64bit was found, but clearly this is not happening in my case.

Both my project and the MapboxGLAndroidSDKTestApp included in this repository throw the same error, but https://github.com/mapbox/mapbox-android-demo runs.

I'm using the same gradle url for fetching MapBox as mapbox-android-demo.

I hope you guys can lend me a hand.

Thanks!

Activity

  1. added
    Android
    on Dec 1, 2015
  2. zugaldia commented on Dec 1, 2015

    @zugaldia
    Member

    Thank you @leofarage for the report. Just to clarify, you're only seeing this message on 64bits devices, right?

    I just tried a fresh build on a Nexus 6p which is a 64 bits device and I couldn't reproduce the issue (see screenshot below). Could you tell us the steps you follow to reproduce this crash? That'd help us troubleshoot the root cause of it. Also, are you seeing this crash with every run, or just during the first time you try to launch the app?

    screenshot_20151201-093900

  3. zugaldia commented on Dec 1, 2015

    @zugaldia
    Member
  4. bleege commented on Dec 2, 2015

    @bleege
    Contributor

    @leofarage Yep, the Mapbox Android SDK don't ship an arm64 .so as part of the Android Library based on information from Google. Could you tell us more about how your project is setup? Are there other native code bases / dependencies as part of it?

    As some background, we regularly develop and test using 64 bit Android devices specifically the Samsung S6 and HTC M9. That's not to say there isn't an issue but I just wanted to let you know that we regularly run it on 64 bit devices (in addition to 32 bit devices).

  5. leofarage commented on Dec 2, 2015

    @leofarage
    Author

    My project has a few other libraries that are being used -- possibly forcing the use of 64 bits .so?

    I tested on the Samsung Galaxy S6 and S6 Edge and both crashed. I'm attaching in the end of the comment the libraries used in the project.

    Both devices crashes on entering the project's MapActivity. The map Activity's layout is made of 2 fragments -- one fragment containing the MapView defined using xml and the other fragment has a recycler view using a Horizontal LinearLayoutManager. Both fragments are child of a RelativeLayout where the MapFragment takes the whole parent and the RecyclerViewFragment takes just 1/4 of the bottom part of the parent -- overlapping the map.

    As I mentioned this repository's example app crashes the same way as my project does. I really don't know what I could be doing wrong.

    Thanks for taking the time for trying to solve my issue.

    Here are the libraries used in the project:

       // Google's support libraries
        compile 'com.android.support:appcompat-v7:23.0.0'
        compile 'com.android.support:design:23.0.0'
        compile 'com.android.support:cardview-v7:23.0.0'
        compile 'com.android.support:recyclerview-v7:23.0.0'
    
        // Google Play service library
        compile 'com.google.android.gms:play-services-location:7.8.0'
    
        // Network libraries
        compile 'com.squareup.retrofit:retrofit:1.9.0'
        compile 'com.google.code.gson:gson:2.3.1'
        compile 'com.squareup.picasso:picasso:2.5.2'
    
        // Facebook SDK
        compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    
        // Crashlytics
        compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
            transitive = true;
        }
    
        // Material dialogs
        compile 'com.afollestad:material-dialogs:0.7.9.1'
    
        // MapBox SDK
        compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:2.2.0@aar'){
            transitive=true
        }
    
        // Card library
        compile 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
        compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
    
        // Image slider
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.daimajia.slider:library:1.1.5@aar'
    
        // Spannable string builder helper
        compile 'com.binaryfork:spanny:1.0.2'
    
        // Card.io library
        compile 'io.card:android-sdk:5.1.0'
    
        // Stripe library
        compile 'com.stripe:stripe-android:+'
    
        // Facebook Parse
        compile 'com.parse.bolts:bolts-android:1.+'
        compile 'com.parse:parse-android:1.+'
    
        // Caligraphy library (for using custom fonts)
        compile 'uk.co.chrisjenx:calligraphy:2.1.0'
    
  6. bleege commented on Dec 2, 2015

    @bleege
    Contributor

    As I mentioned this repository's example app crashes the same way as my project does. I really don't know what I could be doing wrong.

    Ah... one thing to check is to make sure that a germane ABI .so is being generated for the device / emulator that it'll run on. They'll show up in the jniLibs directory of MapboxGLAndroidSDK (see screenshot).

    screen shot 2015-12-02 at 10 04 56 am
    Possible ABI In Project

    ABI are created using the make command in the root of the whole project (not in /android). Here's how those work:

    // Produces armabi-v7a
    make android
    
    // Produce specific ABI
    make android-lib-***
    
    // Specific ABI Example for x86
    make android-lib-x86
    
    // Produces all ABI
    make apackage
    

    My project has a few other libraries that are being used -- possibly forcing the use of 64 bits .so?

    Very possible. If one of those libraries ships an arm64 ABI .so then the device will only look there for them, which is a known issue. That said, looking at your dependencies list I didn't see one. We use many of the same libraries internally too and haven't seen issues with them.

  7. leofarage commented on Dec 9, 2015

    @leofarage
    Author

    Hi, sorry for taking so long to answer -- I was out of the office.

    Anyhow, I found out that the Card.IO library packs the 64 bits libs, consequently it creates a arm64-v8a folder inside the libs folder of the app.

    After removing it from the app the UnsatisfiedLinkError disappeared, instead a new error appeared:

    E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
    E/mbgl: {Main}[OpenGL]: eglCreateWindowSurface() returned error 12296
    A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 22079

    This test was done using a Samsung Galaxy S6 Edge running Android 5.0.2 and a Samsung Galaxy S3 running Android 4.3

    Thanks for all the help!

  8. leofarage commented on Dec 9, 2015

    @leofarage
    Author

    Hi, I realized that the accessToken was missing from the Manifest file -- that solved the issue mentioned above.

    I guess this issue is resolved. The best solution would be the lib packing a 64bits .so but since this is not planned for the near future I'll have to decided what to do about the Card.IO lib.

    Thank you for all the help!

  9. leofarage commented on Dec 9, 2015

    @leofarage
    Author

    So, I found out that gradle supports targeting platforms. I found it in this SO question.

    Using that I forced my project to not attach the 64 bits .so. I guess this is a good solution while Mapbox doesn't support 64 bits.

  10. mmuelder commented on Dec 11, 2015

    @mmuelder

    I am getting the exact same libmapbox-gl.so error as soon as I add compile 'io.realm:realm-android:0.85.0' to my dependencies and jcenter() to the repositories. (HTC One M9, tested in MapBoxAndroidDemo)

  11. added this to the milestone on Dec 14, 2015
  12. bleege commented on Dec 14, 2015

    @bleege
    Contributor

    Thanks for all the insight into arm64 question (and the Gradle filtering option on StackOverflow). For some context / history we looked into this issue in September 2015 and discovered that Google is still only recommending 32 bit .so files.

    This doesn't mean that we are against shipping a 64 bit .so as other libraries can and do, but simply that this is the current state. If you're interesting in adding 64 bit .so support, the first step will be to add it to the Makefile and run make android-lib-arm64 from the Command Line. We ❤️ Pull Requests so please feel free to submit a working arm64 PR.

  13. removed this from the android-v3.0.0 milestone on Dec 21, 2015
  14. 28 remaining items

  15. bleege commented on Mar 16, 2016

    @bleege
    Contributor

    I just successfully tested the arm-64 ABI by doing the following on my Nexus 5x, which runs at 64 bit processor.

    1. Checkout 3128-arch64_android
    2. make clean
    3. make android-lib-arm-v8 -j8
    4. Run TestApp and cycle through entire Test activities in it.

    This confirms to me that the arm-64 ABI works in isolation as expected. 🎆

    The next thing to do is confirm that the other supported ABI continue to work by running it through AWS Device Farm.

    screen shot 2016-03-16 at 7 09 29 pm

    _arm-64 ABI in local SDK_

    screen shot 2016-03-16 at 7 10 45 pm

    _arm-64 ABI in local TestApp_
  16. bleege commented on Mar 17, 2016

    @bleege
    Contributor

    I re ran last night's arm64 test this morning for the arm7 ABI using the stock make android command. Everything worked as expected on the Nexus 5x. Based on these results I'm confident that @tmpsantos solution will work as needed for the arm ABIs.

    The remaining thing to do is to verify that the remaining ABIs (x86, x86-64, mips) work as expected also. To do this @tobrun has produced sample TestApp .apk that include all ABIs (via make apackage) and is working with @zugaldia to upload them to AWS Device Farm for testing across the different ABIs. This should take a few hours, so by the end of the day we should be officially good to go.

    The only remaining thing to do once we get sign off is to add android-lib-arm-v8 back into the make apackage build stack via the Makefile.

    screen shot 2016-03-17 at 11 20 50 am

    _arm 32 bit ABI in local SDK_

    screen shot 2016-03-17 at 11 21 02 am

    _arm 32 bit ABI in local TestApp_
  17. tobrun commented on Mar 17, 2016

    @tobrun
    Member

    The results are in, we are now supporting the same amount as before thus the introduction of the 64 bit was succesfull!

  18. bleege commented on Mar 17, 2016

    @bleege
    Contributor

    Excellent @tobrun @zugaldia ! I'll merge update the Makefile to add arm64 build to it and then merge it into the release branch so it makes it to 4.0.0-final.

  19. added a commit that references this issue on Mar 17, 2016
    51a3907
  20. bleege commented on Mar 17, 2016

    @bleege
    Contributor

    It looks like @tmpsantos merged this into master already which didn't show up until after I refreshed this page on GitHub. D'oh! Based on how GitHub automatically closed this issue via 51a3907 it looks like that's the only commit I'll need to cherry pick to the release-ios-3.2.0-android-4.0.0 branch to get the arm64 support added. I'll also cherry pick 08f92ff19989552149fd4c1a369ce999da57afe5 as it formally adds arm64 to the Android Library .aar build process.

  21. reopened this on Mar 17, 2016
  22. bleege commented on Mar 17, 2016

    @bleege
    Contributor

    As usual @tmpsantos is one step of ahead of me and has added the arm64 inclusion in PR #4366. So the new plan is to merge that PR into master. Once that's done, I'll cherry pick both files over to the release branch and then close this ticket.

  23. added a commit that references this issue on Mar 17, 2016
    fc0f32b
  24. bleege commented on Mar 17, 2016

    @bleege
    Contributor

    I just cherry picked the two commits as discussed with @tmpsantos from master to release-ios-3.2.0-android-4.0.0. I'm going to fire off a new SNAPSHOT from release-ios-3.2.0-android-4.0.0 so that we can make this available ASAP.

    Big thanks to @tmpsantos for solving this problem! 💥

    screen shot 2016-03-17 at 2 33 42 pm

    _arm64 Fix Commits Cherry Picked Onto Release Branch_
  25. leofarage commented on Mar 22, 2016

    @leofarage
    Author

    Awesome! Congratulations!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions