Closed huangliqiang closed 6 years ago
Does it also occur with the latest version?
The exception itself is not a piwik issue, but it should not crash the library. Did it crash the library? I can't tell from your stacktrace where the exception originates, as there are no line numbers for the library.
@d4rken i wan to use the 2.0library the exception at org.piwik.sdk.dispatcher.Dispatcher.dispatch(Dispatcher.java) if you try catch(ArrayIndexOutOfBoundsException) at Dispatcher.java 253line , will useful?
Why do yo not want to use v3.0
?
There will be no extra releases for v2.X
, but you are of course free to fork the repo and make the changes yourself.
The error itself is likely a bug in an older version of okhttp that has been packaged with Android itself:
https://github.com/square/okhttp/issues/3194 https://github.com/square/okhttp/issues/1776
This is still interesting to fix for v3.X
. To fix this we can either include okhttp explicitly, to get newer versions, or catch the error as you suggested which is what others have also been doing:
https://github.com/mozilla-mobile/telemetry-android/commit/37bff7dce90e54f3a4dbe0e1f8cc3d53bc827402
I guess it depends on how much overhead the explicit depenency on okhttp is. I think it would not be worth it just to fix this...
@d4rken Thank you for your answer。 i donot wan to use v3.0 because this version neet to update Android studio 3.0, but i wan to use Android studio 2.2.3. and i think v3.0 also has the exception, the two versions are very different.
This problem has affected my releases APK operation. if this : mozilla-mobile/telemetry-android@37bff7d suggestion is useful, can you update this code for v2.0 and v3.0 version ? Thank you very much.
The issue is not present on v3.0
due to the wider catch:
https://github.com/matomo-org/piwik-sdk-android/blob/master/piwik-sdk/src/main/java/org/piwik/sdk/dispatcher/DefaultPacketSender.java#L62
I don't want to support multiple update tracks. There will be no legacy version fixes. You can either upgrade to 3.0
or fork 2.0
and apply the changes yourself.
Sorry that I can't be of more help.
i use org.piwik.sdk:piwik-sdk:2.0.0 has this cash log :: cash with org.piwik.sdk.dispatcher.Dispatcher.dispatch