MapBox Android application crashes after update to SDK 4.1.0 on emulator

后端 未结 4 1603

After the update to Android MapBox SDK 4.1.0/4.1.1 my app crashes on Android emulator with:

E/mbgl: [Shader]: Vertex shader fill failed to compile: precision         


        
相关标签:
4条回答
  • 2021-01-16 12:15

    I have verified that this issue does in fact crash Android x86 physical devices. RemixOS has the exact same crash as can be seen from catlog - if anyone wants the full log - let me know, but its mostly the same as above except that I also have the reg dump and backtrace showing that it was the mapbox SDK that originated the issue.

    My guess is that the issue is because most Android x86 devices aren't supporting the ES variant of OpenGL (for embedded devices), but rather the full desktop spec. This is normally not a concern, but the #ifdef specifically tests for the ES variant and then #define's away a few types that I think need to be defined. The ES variant sets highp to a float while the non-ES code leaves it blank! This would cause the compilation problem (basically JIT via LLVM) and then the lack of code and the crash-n-burn.

    0 讨论(0)
  • 2021-01-16 12:16

    Is this known problem? Can this crash affect production build on physical devices? Is there any workaround?

    Answer

    • If you crash on a x86 emulator, then there is a really good chance it will crash on a x86 device.
    • If you pass testing on a ARM device, there is a really good chance your app will work fine on ARM devices
    • If that doesn't answer your initial question, then there is Mapbox issue #5456 that has some discussion.

    I also saw the same crash on an x86 emulator in OS X with Android Studio. The same app passed on an ARM device.

    As you mentioned, the emulators are Intel x86 Atom_System images.

    The Mapbox Android SDK compiled in with gradle as an AAR file includes several shared objects for different device processors including for ARM, x86 and MIPS.

    That is, when you use this

    compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.0@aar')
    

    You get several libmapbox-gl.so shared objects in your Android APK

    0 讨论(0)
  • 2021-01-16 12:28

    For those using the emulator:

    This can be fixed by changing your emulated graphics to Software - GLES 2.0 in your AVD settings. This is not ideal, but it will work (and is still much faster than emulating an ARM device).

    I suspect this is emulator specific.

    0 讨论(0)
  • 2021-01-16 12:36

    I'll assume you mean Android Mapbox SDK 4.1.0/4.1.1 and not DropBox ;)

    First, make sure you are always using the latest version of the SDK, 4.1.1 fixes an important bug that can potentially break your app. This sounds like an issue with the emulator possibly not having OpenGL setup properly. I'm not familiar with Linux Mint but you will need to make sure your graphics driver is installed and up to date. It will also need to be able to support OpenGL 2.0 or higher.

    We don't guarantee Mapbox will be able to work on an emulator but we do strive to ensure Mapbox works on as many physical devices as possible. If an emulator must be used, we recommend either the built in Android Studio one or Genymotion.

    0 讨论(0)
提交回复
热议问题