expo: GLView crashing in bare project

Environment

Expo CLI 2.11.9 environment info: System: OS: Windows 10 Binaries: Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.1.0.0 AI-173.4907809

Target

A real Android Pie device

Steps to Reproduce

  1. expo init --template bare-minimum
  2. yarn add expo-gl, yarn add expo-gl-cpp
  3. Adding GLPackage to MainApplication.java
  4. Adding GLView from expo-gl to the app component
  5. yarn android

Expected Behavior

App should not crash and show at least a black box.

Actual Behavior

App crashes and closes immediately after opening. Just got a very short glimpse at the black box. This happens always - even if I don’t pass the onContextCreate param or trying to paint a black box on the canvas.

The debug log from Android Studio says:

E/SoLoader: couldn’t find DSO to load: libexpo-gl.so caused by: dlopen failed: “/data/data/com.chllng/lib-main/libexpo-gl.so” is 32-bit instead of 64-bit E/AndroidRuntime: FATAL EXCEPTION: mqt_js Process: com.chllng, PID: 16188 java.lang.UnsatisfiedLinkError: couldn’t find DSO to load: libexpo-gl.so caused by: dlopen failed: “/data/data/com.chllng/lib-main/libexpo-gl.so” is 32-bit instead of 64-bit

If I add ndk.abiFilters "armeabi-v7a", "x86", this error goes, but I got:

A/libc: Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x2e in tid 25832 (mqt_js), pid 25760 (com.chllng)

Any ideas how to solve this?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 29 (4 by maintainers)

Most upvoted comments

Hello there, I spent some time removing all the company-specific code and created a demo. Repo can be seen here: https://github.com/reimertz/expo-three-demo

demo

You are a life saver!!! I’m not really sure what was much different from my project to yours other than I started with an Expo Bare project, but yours was clearly a conversion from a basic React Native project. I took that path and now everything seems to be working, which leads me to believe the issue is with the Expo package itself.

Thank you so much for providing that repo, @reimertz !

@Asday - i see the following when doing that:

Screen Shot 2022-01-18 at 4 36 31 PM

here’s the repo: https://github.com/brentvatne/asday

this is expected behavior because you cannot use remote debugging in chrome with expo-gl - https://docs.expo.dev/versions/latest/sdk/gl-view/#remote-debugging--glview

you could try using it with hermes and then use the inspector to debug: https://docs.expo.dev/guides/using-hermes/#javascript-inspector-for-hermes

@Asday - can you share a reproducible example? this works as expected in our tests

I’m seeing the exact same issue in SDK 35 in a Bare app. The app simply doesn’t load when remote debugging is disabled, and will crash on the screen using GLView when it is enabled.

Here’s the commit to mention this issue in the docs: Add info about GLView not working when debugging is enabled

I’m shooting in the dark here but as you (@cruzach and @tsapeta) are responsible for this commit, could you possibly have some insight into this issue?

@Cwejman That documentation still said that in SDK32, and all that happened there was that onContextCreate was never called.

Now it just hard crashes the whole app. That’s not “not functioning as intended”, that’s “a huge regression”.