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

Unable to create call adapter for class io.reactivex.Observable ; Unable to create call adapter for class io.reactivex.Observable ; Observable return type must be parameterized as Observable<Foo> or Observable<? extends Foo> #118

Open
zy623 opened this issue Dec 10, 2024 · 1 comment

Comments

@zy623
Copy link

zy623 commented Dec 10, 2024

一旦开启混淆,就会无法调用接口,observable返回值没有泛型,但是泛型相关实体都已经配置不混淆。不太确定是不是gradle升级到8.6导致的问题,在8.6之前打的release版本都没有问题。

@zy623
Copy link
Author

zy623 commented Dec 10, 2024

io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.IllegalArgumentException: Unable to create call adapter for class io.reactivex.Observable
for method ApiService.getYzm
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:67)
at io.reactivex.observers.SerializedObserver.onNext(SerializedObserver.java:111)
at io.reactivex.internal.operators.observable.ObservableThrottleFirstTimed$DebounceTimedObserver.onNext(ObservableThrottleFirstTimed.java:82)
at com.jakewharton.rxbinding2.view.ViewClickObservable$Listener.onClick(ViewClickObservable.java:39)
at android.view.View.performClick(View.java:7322)
at android.view.View.performClickInternal(View.java:7296)
at android.view.View.access$3600(View.java:839)
at android.view.View$PerformClick.run(View.java:28319)
at android.os.Handler.handleCallback(Handler.java:908)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8679)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
Caused by: java.lang.IllegalArgumentException: Unable to create call adapter for class io.reactivex.Observable
for method ApiService.getYzm
at retrofit2.Utils.methodError(Utils.java:54)
at retrofit2.HttpServiceMethod.createCallAdapter(HttpServiceMethod.java:116)
at retrofit2.HttpServiceMethod.parseAnnotations(HttpServiceMethod.java:67)
at retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:39)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:202)
at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy3.getYzm(Unknown Source)
at com.tjjt.jtjy.data.source.http.HttpDataSourceImpl.getYzm(HttpDataSourceImpl.java:104)
at com.tjjt.jtjy.data.HttpRepository.getYzm(HttpRepository.java:95)
at com.tjjt.jtjy.ui.login.LoginViewModel.getYzm(LoginViewModel.java:142)
at com.tjjt.jtjy.ui.login.LoginViewModel.access$300(LoginViewModel.java:41)
at com.tjjt.jtjy.ui.login.LoginViewModel$6.call(LoginViewModel.java:122)
at me.goldze.mvvmhabit.binding.command.BindingCommand.execute(BindingCommand.java:47)
at me.goldze.mvvmhabit.binding.viewadapter.view.ViewAdapter$2.accept(ViewAdapter.java:46)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
... 14 more
Caused by: java.lang.IllegalStateException: Observable return type must be parameterized as Observable or Observable<? extends Foo>
at retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory.get(RxJava2CallAdapterFactory.java:118)
at retrofit2.Retrofit.nextCallAdapter(Retrofit.java:253)
at retrofit2.Retrofit.callAdapter(Retrofit.java:237)
at retrofit2.HttpServiceMethod.createCallAdapter(HttpServiceMethod.java:114)
... 28 more

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

1 participant