Ankush Kapoor
Ankush Kapoor

Reputation: 543

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

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?

Upvotes: 4

Views: 3683

Answers (1)

Nosillock
Nosillock

Reputation: 71

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://[email protected]/0" />
</application>

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

Follow the below link for documentation. Native Initialize

Upvotes: 4

Related Questions