react-native-skia icon indicating copy to clipboard operation
react-native-skia copied to clipboard

UnsatisfiedLinkError: cannot locate symbol "__cxa_init_primary_exception" on Android with React Native 0.79.2

Open naderabdelghany opened this issue 2 months ago • 5 comments

Description

I'm encountering a native linking error when trying to use react-native-skia (via the react-native-animated-glow package) on Android, everything works just fine on iOS though. The app crashes on launch with an UnsatisfiedLinkError indicating that the symbol __cxa_init_primary_exception cannot be located in librnskia.so.

Error:

Exception in HostFunction: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__cxa_init_primary_exception" referenced by "/data/app/~~CClSDx8Izzsu_ctmvVMOvQ==/com.nk.USANewsUpdates-gC0opkJyMQ2ULN27d7r6nQ==/base.apk!/lib/arm64-v8a/librnskia.so"...
    at com.shopify.reactnative.skia.RNSkiaModule.install(RNSkiaModule.java:54)

The error occurs when the Skia object is accessed in the component, resulting in Skia being undefined which then causes a render error: Cannot read property 'Skia' of undefined.

I've tried and verified that:

  • The ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON flag is already present in node_modules/@shopify/react-native-skia/android/build.gradle (line 161)
  • I've performed a complete clean build process multiple times
  • I've uninstalled the old app before rebuilding

The issue persists across all attempts.

Additional Context:

  • NDK Version: 28.2.13676358
  • compileSdkVersion: 35
  • targetSdkVersion: 35
  • minSdkVersion: 24
  • Gradle plugin version: (automatically resolved by RN 0.79.2)
  • Build Tools: 35.0.0
  • Kotlin version: 2.0.21

React Native Skia Version

2.3.0

React Native Version

0.79.2

Using New Architecture

  • [ ] Enabled

Steps to Reproduce

  1. Create a React Native 0.79.2 project with React 19.0.0
  2. Install @shopify/react-native-skia@^2.3.0
  3. Install react-native-animated-glow@^3.0.1 (which depends on react-native-skia)
  4. Try to use any Skia component
  5. App crashes on launch with the UnsatisfiedLinkError

Snack, Code Example, Screenshot, or Link to Repository

The following are the crash errors:

Image Image Image

naderabdelghany avatar Oct 10 '25 03:10 naderabdelghany

https://github.com/Shopify/react-native-skia/issues/3392#issuecomment-3414077681

This will help you

ankit2saurabh avatar Oct 17 '25 06:10 ankit2saurabh

#3392 (comment)

This will help you

I applied said patch in the comment you mention with the NDK version I already have in my android/build.gradle which is 28.2.13676358 using Yarn and made sure I ran yarn install after but I still got the same errors on Android despite seeing the UnifiedSkiaGlow.tsx file being dynamically bundled to both iOS and Android emulators in the Metro bundler

naderabdelghany avatar Oct 22 '25 02:10 naderabdelghany

@naderabdalghani if you provide a reproduction, I could take a look

wcandillon avatar Oct 22 '25 07:10 wcandillon

@naderabdalghani Could this be an issue w/ using NDK 28? From what I can tell, even the latest versions of RN are on NDK 27. Is there a specific reason you are using NDK 28?

DigitalZebra avatar Nov 05 '25 21:11 DigitalZebra

@naderabdalghani Could this be an issue w/ using NDK 28? From what I can tell, even the latest versions of RN are on NDK 27. Is there a specific reason you are using NDK 28?

Yes, to support 16 KB memory page sizes by default

naderabdelghany avatar Nov 05 '25 23:11 naderabdelghany