Sentry React Native Crash – Native Client is not available, can't start on native

Issue

I am getting crash on app launch in android with below error.

Native Client is not available, can’t start on native.

Sentry.init({
        enableNative: true,
        enableNativeCrashHandling: true,
        dsn:
            'https://xyx.com/sentry/12',
      })

When I set enableNative: false, then the crash stops coming but the android related crashes are not logged in sentry.

I have added sentry in build.gradle as well as per the sentry integration doc.

Any solution for this?

Solution

I had this problem as well, using the test of Sentry.nativeCrash() – the application would crash, but not be reported.

To fix, set autoInitializeNativeSdk to false and initialize in the AndroidManifest.

Sentry.init({
    autoInitializeNativeSdk: false,
    dsn:
        'https://xyx.com/sentry/12',
  })

Initialize the AndroidSDK in your AndroidManifest.xml

<application>
  <meta-data android:name="io.sentry.auto-init" tools:replace="android:value" android:value="true" />
  <meta-data android:name="io.sentry.dsn" android:value="https://examplePublicKey@o0.ingest.sentry.io/0" />
</application>

Make sure you add xmlns:tools="http://schemas.android.com/tools" to your manifest.

Follow the below link for documentation.
Native Initialize

Answered By – Nosillock

Answer Checked By – Cary Denson (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *