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.
I am facing an issue trying to instantiate an Analytics instance, with (possibly) a
writeKeywhich was previously used.Once I call
analytics.reset(), I expect to be able to build a new instance ofAnalyticswith the previously usedwriteKey, without raising an exception.Instead, this exception is raised:
analytics-android/analytics/src/main/java/com/segment/analytics/Analytics.java
Lines 1294 to 1298 in 639eedf
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
INSTANCEsilently? The current APIs don't seem to allow me to do this.