-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some crashes with missing virtual method #977
Comments
BTW: I did not change the Fuel version for a long time, so I guess it will be something in the build process. Strange is: it works when it's called "manually" (called by a one-time Worker process), but (at least sometimes) it does not work in a scheduled Worker process. Other idea: can it be that that "missing" method is called when there's a problem with the data passed to it, and I cannot reproduce it (and it has that strange pattern) as the data I get does not have that problem? |
Whenever NoSuchMethodError or similar problems come up, it's usually one of two things:
|
Hi, The crashes due to missing virtual methods are concerning. Could you provide more context on the environments and scenarios where these crashes occur? I’m willing to help investigate and resolve these issues to improve Fuel’s stability.
|
Well it has not happened any more, so I (hope/guess) it was a problem of dependencies, although I did numerous "Cleans" and other more or less duious attempts, and it happened in the same code (!) of a Worker process, just the way it being called (one-time or periodic) was the problem - left me wondering. It is too long ago to know what I did to make it work, my memory is short-term and tasks are getting "lost" once solved. I will get back to you when I experience it again - assume the case as closed for the moment. |
Oh, you won't believe it... it just came in: I just got a mail of a customer with that problem:
And now I remember: it happens when there's a failure in the call (here: too many calls, log says:
Is it that I expect a JSON object as result and I get a string? |
The code I use is
|
I think it is expecting FuelError but you expect it to be JSON. Why are you not using success {} and failure {}? |
If I knew how to (I use Java, and that code is Kotlin ;) I found no way to do this - can I define multiple handlers for these 2 error result types (string and json), and if yes, how? Could you please help me? Do you mean
and switch upon the contents of the byte[] which handler to use (synchroneous?)? Which is the preferred way to handle this problem? |
I believe it is only one handler at a time. The both handlers should be synchronous. |
I think I worked it out. |
Some customers of mine start to experience problems with the following stack trace:
STACK_TRACE=java.lang.NoSuchMethodError: No virtual method error(Ljava/lang/Exception;)Lcom/github/kittinunf/result/Result$Failure; in class Lcom/github/kittinunf/result/Result$Companion; or its super classes (declaration of 'com.github.kittinunf.result.Result$Companion' appears in base.apk!classes3.dex) at com.github.kittinunf.fuel.core.DeserializableKt.response(Deserializable.kt:171) at com.github.kittinunf.fuel.core.requests.DefaultRequest.responseObject(DefaultRequest.kt:490) at com.chk.go_elocal.database.flextariff.provider.Tibber.updateStatistics(Tibber.java:201)
caused as you can see by the call of the "request.responseObject" in Java code:
Triple<Request, Response, Result<FuelJson, FuelError>> result = request.responseObject(FuelJsonKt.jsonDeserializer()); Result<FuelJson, FuelError> responseResult = result.getThird();
Version is the current stable version 2.3.1, and it just happens in release builds (on Android).
implementation 'com.github.kittinunf.result:result:5.6.0' implementation "com.github.kittinunf.fuel:fuel:$fuel_version" implementation "com.github.kittinunf.fuel:fuel-android:$fuel_version" implementation "com.github.kittinunf.fuel:fuel-json:$fuel_version"
Strange: The same call works (in some other class) for the same customers when I use a full object path:
Triple<Request, Response, com.github.kittinunf.result.Result<FuelJson, FuelError>> result = request.responseObject(FuelJsonKt.jsonDeserializer()); com.github.kittinunf.result.Result<FuelJson, FuelError> responseResult = result.getThird();
although the "import" in the other class file has the same path.
Does anybody know what could be the reason? Ther was a gradle update at the end of november, but actually I don't know the build process good enough to know whether something like that could cause it...
The text was updated successfully, but these errors were encountered: