Received null when initializing Dracoon Client
Hello everyone,
We are having some issues with one of our Android devices when trying to use Dracoon implementation. After debugging code and testing what may be causing this issue, we found that when the Dracoon Client is initialized, when the library gets to the function isApiVersionGreaterEqual(), the server returns a null value just on this device, causing the app to throw a NullPointer error when it gets to the split() function that separates this value. As this seems a problem with the library itself, we can't make it work with these devices from our side.
How can we fix it? Thanks
-
Hello Ivan,
Could you please provide a stack trace of the error?
Currently, I can't explain the error/cause to myself. The server should not return a null value at this point. And it is strange, that you have this problem only on one device.
I will prepare a fix to handle a possible null value.
Best regards
Matthias -
Sure, here are the logs that we are getting from this device about the error:
W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
W/System.err: at com.dracoon.sdk.internal.DracoonClientImpl.isApiVersionGreaterEqual(DracoonClientImpl.java:414)
W/System.err: at com.dracoon.sdk.internal.DracoonClientImpl.assertApiVersionSupported(DracoonClientImpl.java:322)
W/System.err: at com.dracoon.sdk.internal.DracoonClientImpl.init(DracoonClientImpl.java:227)
W/System.err: at com.dracoon.sdk.DracoonClient$Builder.build(DracoonClient.java:1385)
W/System.err: at com.teamwire.messenger.dracoon.DracoonDetailsActivity.onInitialized$lambda-4(DracoonDetailsActivity.kt:107)
W/System.err: at com.teamwire.messenger.dracoon.DracoonDetailsActivity.$r8$lambda$A-SfPoqtRHsPcZdh2f2ZIjPAQvk(Unknown Source:0)
W/System.err: at com.teamwire.messenger.dracoon.DracoonDetailsActivity$$ExternalSyntheticLambda4.run(Unknown Source:6)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err: at java.lang.Thread.run(Thread.java:919)Thanks for your help, and again, just let me know if we can help with something else
-
Hello Ivan,
I made a fix to prevent the NullPointerException. However, I think this might not solve your problem completely.
Could you please send me a recording or logs of the HTTP messages?
You can use an OkHttp interceptor to log requests/responses.
Request/response should look like this:
2021-11-04 11:57:56 d/OkHttpInterceptorExamples 11:57:56: Request: (0)
GET: https://dracoon.team/api/v4/public/software/version
2021-11-04 11:57:57 d/OkHttpInterceptorExamples 11:57:57: Response: (0)
200
Body:
{
"restApiVersion" : "4.32.1",
"sdsServerVersion" : "4.32.1",
"buildDate" : "2021-11-02T12:21:03Z",
"isDracoonCloud" : true
}Best regards
Matthias
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare