Search code examples
androidandroid-manifestsentrymanifest-merging

Sentry Auto-init does not work because it is disabled in the library being used


I use Sentry configuration via AndroidManifest.xml. In the manifest I have these lines:

  <meta-data android:name="io.sentry.dsn" android:value="my_value" />
  <meta-data android:name="io.sentry.traces.user-interaction.enable" android:value="true" />
  <meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
  <meta-data android:name="io.sentry.traces.profiling.sample-rate" android:value="1.0" />

But Sentry console is empty and i see this in logcat:

io.sentry.auto-init read: false

I also check used libs and found that one of them has this line in the own manifest:

<meta-data android:name="io.sentry.auto-init" android:value="false" />

So I tried to add this line to my manifest:

<meta-data android:name="io.sentry.auto-init" android:value="false" tools:replace="android:value"/>

And it looks like sentry is now working, but is this the right decision? What could be the consequences?


Solution

  • We don't recommend using sentry in SDKs/libraries due to the following reasons:

    enter image description here

    Which library is doing that exactly? You should approach them and let them know that they shouldn't call SentryAndroid.init or Sentry.init as a library, because it will conflict with the hosting application.