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

Shader compilation crashes on Android emulators #415

Closed
almithani opened this issue Sep 14, 2016 · 11 comments
Closed

Shader compilation crashes on Android emulators #415

almithani opened this issue Sep 14, 2016 · 11 comments

Comments

@almithani
Copy link

After upgrading to react native 0.32 (from 0.26), I started to experience crashes on my Android emulator when displaying a map. I had been using Android SDK Tools 25.2.2, but downgraded to 25.1.7 and am now about to display the map successfully on my emulator.

Here's the relevant Android Monitor output:

09-14 12:11:26.477 3674-3674/com.MyMapProj E/mbgl: [Shader]: Shader failed to compile: ERROR: Valid GLSL but not GLSL ES
09-14 12:11:26.477 3674-3674/com.MyMapProj E/mbgl: [Shader]: Vertex shader fill failed to compile: precision highp float;
                                                  #ifdef GL_ES
                                                  precision highp float;
                                                  #else
                                                  #define lowp
                                                  #define mediump
                                                  #define highp
                                                  #endif

                                                  attribute vec2 a_pos;

                                                  uniform mat4 u_matrix;

                                                  void main() {
                                                      gl_Position = u_matrix * vec4(a_pos, 0, 1);
                                                  }
09-14 12:11:26.477 3674-3674/com.MyMapProj A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadcab1 (code=1), thread 3674 (com.MyMapProj)
09-14 12:11:26.747 1130-1130/? E/Corkscrew: unrecognized dwarf lower part encoding: 0x22
09-14 12:11:26.897 1567-1599/system_process E/InputDispatcher: channel '9d37e248 com.MyMapProj/com.MyMapProj.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
@1ec5
Copy link
Contributor

1ec5 commented Sep 18, 2016

This sounds like mapbox/mapbox-gl-native#5878.

@mgtitimoli
Copy link

Hi,

I'm experiencing the same... Has someone found a workaround to use while we get to a final solution?

Thanks!

@almithani
Copy link
Author

@mgtitimoli My comment above mentions that downgrading Android SDK Tools worked for me. Did you try that?

@mgtitimoli
Copy link

mgtitimoli commented Sep 20, 2016

thanks @almithani, no I haven't yet, it can't be done using the sdk manager, so I was looking for the link to download it manually... Which is your current setup, so I try with that one?

@almithani
Copy link
Author

@mgtitimoli http://dl-ssl.google.com/android/repository/tools_r25.1.7-macosx.zip

@mgtitimoli
Copy link

mgtitimoli commented Sep 21, 2016

(Thanks @almithani! Map is alive again...)

I can confirm this setup is working in case anyone is experiencing the same (there is no way to downgrade tools and platform tools, this is why I'm leaving all the links to download them manually and unzip it directly in your installation folder):

  1. Android SDK version 24.4.1
    • this one is the entire SDK, I'm leaving it here in case you want to start from scratch, otherwise you can use what you already have and overwrite the specific folders with the packages specified below
  2. Tools version 25.1.7
  3. Platform Tools version 23.1.0
  4. Android Support Repository (extras) version 38
    • this one goes under $ANDROID_HOME/extras/android
  5. Available to download directly using SDK Manager (android sdk)
  • Android SDK Build-tools version 23.0.3
  • Android SDK Build-tools version 23.0.2
  • Android SDK Build-tools version 23.0.1
  • Android 6.0 (API 23)
    • SDK Platform version 23.3
    • Google APIs Intel x86 Atom_64 System Image version 23.16

Hope this issue gets resolved soon...

@1ec5
Copy link
Contributor

1ec5 commented Sep 21, 2016

Now tracking upstream in mapbox/mapbox-gl-native#6400.

@1ec5
Copy link
Contributor

1ec5 commented Sep 21, 2016

/cc @ivovandongen @cammace

@uudruid74
Copy link

Try running the emulator with -gpu swiftshader, like this:
LD_PRELOAD='/usr/lib64/libstdc++.so.6' emulator -no-boot-anim -netdelay none -netspeed full -avd Nexus_5_API_22_x86 -gpu swiftshader -qemu -m 1526

@Hahihula
Copy link

Hahihula commented Oct 29, 2016

The downgrade sadly don't worked for me ... it still crashes even the example app on emulator, bud on physical device it works ...
I only write here with working link to the platform tools 25 because the link by @mgtitimoli seems to be dead:
linux:
http://dl-ssl.google.com/android/repository/platform-tools_r25-linux.zip
windows:
http://dl-ssl.google.com/android/repository/platform-tools_r25-windows.zip
macos:
http://dl-ssl.google.com/android/repository/platform-tools_r25-macosx.zip

@ghost
Copy link

ghost commented Mar 27, 2018

@uudruid74 Thanks so much for this! the '-gpu swiftshader' fixed a lot of crashes i've been getting. Much appreciated!

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

No branches or pull requests

6 participants