Skip to content

Duplicate analytics client exception is raised after having reset the client #538

@lynfogeek

Description

@lynfogeek

I am facing an issue trying to instantiate an Analytics instance, with (possibly) a writeKey which was previously used.

Once I call analytics.reset(), I expect to be able to build a new instance of Analytics with the previously used writeKey, without raising an exception.
Instead, this exception is raised:

throw new IllegalStateException(
"Duplicate analytics client created with tag: "
+ tag
+ ". If you want to use multiple Analytics clients, use a different writeKey "
+ "or set a tag via the builder during construction.");

The same use of the "analytics-ios" SDK works.

Could you consider a way to better reset the internals of the framework? or reuse an existing INSTANCE silently? The current APIs don't seem to allow me to do this.

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