Skip to content

Android "Duplicate analytics client created" #16

@cristeahub

Description

@cristeahub

This is a common issue on segment libraries for Android. The issue is that when you have already initialized the segment module on Android you cannot initialize it again without the app crashing.

This happens a lot when doing React Native development on Android, as running the Reload function (shake your device and press Reload) will cause this crash.

One solution is to guard the initialization on Android. While the doc of this project says you can catch errors when setting up, it doesn't seem to be working right now.

Here are some related issues in other repos with the same error:
https://github.com/leoilab/react-native-analytics-segment-io/issues/3
segmentio/analytics-android#538

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions