Skip to content
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

java.lang.IllegalArgumentException: Unable to create converter for com.xtc.oauth.sdk.net.bean.response.bean.OauthNetResponseBaseBean<com.xtc.oauth.sdk.net.bean.response.bean.OauthAccessTokenResponseBean> #2015

Closed
ouyangpeng opened this issue Sep 13, 2016 · 4 comments

Comments

@ouyangpeng
Copy link

My app use retrofit + rxjava run well on Android 5.1 (API 22) system,the aar version is 👍
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.0' compile 'com.squareup.retrofit2:retrofit:2.0.0' compile 'com.squareup.retrofit2:converter-jackson:2.0.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0' compile 'io.reactivex:rxandroid:1.1.0'

but when my app runs on Android 4.2 (API 17) crashed, the crashed report :
09-13 10:59:26.791 15260-15260/com.xtc.oauth.sdk.demo E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.xtc.oauth.sdk.demo/com.xtc.oauth.sdk.demo.MainActivity}: java.lang.IllegalArgumentException: Unable to create converter for com.xtc.oauth.sdk.net.bean.response.bean.OauthNetResponseBaseBean<com.xtc.oauth.sdk.net.bean.response.bean.OauthAccessTokenResponseBean> for method a.a at android.app.ActivityThread.deliverResults(ActivityThread.java:3319) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5041) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalArgumentException: Unable to create converter for com.xtc.oauth.sdk.net.bean.response.bean.OauthNetResponseBaseBean<com.xtc.oauth.sdk.net.bean.response.bean.OauthAccessTokenResponseBean> for method a.a at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:667) at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:653) at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:166) at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:166) at retrofit2.Retrofit$1.invoke(Retrofit.java:145) at $Proxy1.a(Native Method) at com.xtc.oauth.sdk.XTCOauthApiAgent.getAccessToken(XTCOauthApiAgent.java:176) at com.xtc.oauth.sdk.demo.MainActivity.onActivityResult(MainActivity.java:127) at android.app.Activity.dispatchActivityResult(Activity.java:5293) at android.app.ActivityThread.deliverResults(ActivityThread.java:3315) ... 11 more Caused by: java.lang.TypeNotPresentException: Type java.util.Objects not present at org.apache.harmony.luni.lang.reflect.ImplForType.getRawType(ImplForType.java:64) at org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.java:73) at org.apache.harmony.luni.lang.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:61) at org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:53) at org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.java:72) at org.apache.harmony.luni.lang.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:61) at org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:53) at org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.java:72) at org.apache.harmony.luni.lang.reflect.ListOfTypes.resolveTypes(ListOfTypes.java:61) at org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:53) at org.apache.harmony.luni.lang.reflect.Types.getClonedTypeArray(Types.java:24) at java.lang.reflect.Method.getGenericParameterTypes(Method.java:225) at com.fasterxml.jackson.databind.introspect.AnnotatedMethod.getParameterType(AnnotatedMethod.java:195) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:505) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:228) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:406) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264) at com.fasterxml.jackson.databind.deser.Des

I try to use of a low version of the retrofit 2.0.0-beta3 ,Converter: Jackson 2.0.0-beta3, Adapter: RxJava 2.0.0-beta3 ,but the problem is still not resolved, still crash when running

How can I solve this problem, don't retrofit be compatible with android4.0 as well as the following version?

@swankjesse
Copy link
Member

Please ask usage questions on StackOverflow. Bug reports need executable test cases.

@ouyangpeng
Copy link
Author

I have tried to search the StackOverflowweb site for the problem, but did not solve the problem。I decided to give up Retrofit, switch to the third party network framework that is compatible with Android2.3.

@JakeWharton
Copy link
Member

As evidenced by your stack trace this is not a Retrofit problem anyway

@ouyangpeng
Copy link
Author

@JakeWharton This is really not the retrofit problem, the really problem is that the Jackson converter is wrong, and now I am trying to use a custom converter.
I hope the custom converter could to be effective , after all, the project is written by using retrofit, if rewrite it by using the other HTTP framework , it's waste of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants