gpt4 book ai didi

android - NoClassDefFoundError : rx. subscriptions.CompositeSubscription

转载 作者:太空狗 更新时间:2023-10-29 15:59:59 26 4
gpt4 key购买 nike

我有一个 Android 项目,我在其中使用了 rxjavarxAndroid。我突然开始遇到崩溃 "NoClassDefFoundError: rx.subscriptions.CompositeSubscription"

网上查了下,没找到解决办法

java.lang.ExceptionInInitializerError
at rx.plugins.RxJavaSchedulersHook.createIoScheduler(RxJavaSchedulersHook.java:84)
at rx.plugins.RxJavaSchedulersHook.createIoScheduler(RxJavaSchedulersHook.java:72)
at rx.schedulers.Schedulers.<init>(Schedulers.java:70)
at rx.schedulers.Schedulers.getInstance(Schedulers.java:47)
at rx.schedulers.Schedulers.newThread(Schedulers.java:108)
at com.myPackage.controllers.modelsControllers.CountriesController.loadCountries(CountriesController.java:121)
at com.myPackage.views.fragments.ChatFragment.onCreateView(ChatFragment.java:57)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:829)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035)
at android.app.BackStackRecord.run(BackStackRecord.java:635)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1397)
at android.app.Activity.performStart(Activity.java:5017)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: rx.subscriptions.CompositeSubscription
at rx.internal.schedulers.CachedThreadScheduler$CachedWorkerPool.<init>(CachedThreadScheduler.java:48)
at rx.internal.schedulers.CachedThreadScheduler.<clinit>(CachedThreadScheduler.java:139)
at rx.plugins.RxJavaSchedulersHook.createIoScheduler(RxJavaSchedulersHook.java:84) 
at rx.plugins.RxJavaSchedulersHook.createIoScheduler(RxJavaSchedulersHook.java:72) 
at rx.schedulers.Schedulers.<init>(Schedulers.java:70) 
at rx.schedulers.Schedulers.getInstance(Schedulers.java:47) 
at rx.schedulers.Schedulers.newThread(Schedulers.java:108) 
at com.myPackage.controllers.modelsControllers.CountriesController.loadCountries(CountriesController.java:121) 
at com.myPackage.views.fragments.ChatFragment.onCreateView(ChatFragment.java:57) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:829) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035) 
at android.app.BackStackRecord.run(BackStackRecord.java:635) 
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1397) 
at android.app.Activity.performStart(Activity.java:5017) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
at android.app.ActivityThread.access$600(ActivityThread.java:130) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:4745) 
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:786) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
at dalvik.system.NativeStart.main(Native Method) 

我并没有真正改变类中的任何东西,这是抛出异常,这让我很困惑。

在我的 build.gradle 中,我编译了 'io.reactivex:rxandroid:1.2.1' 编译'io.reactivex:rxjava:1.1.6'

在我的 observable 中,我使用 okHttp 发送 http 请求,抛出异常的确切行是

subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread());

我需要任何建议^^,如果您有任何问题,请告诉我。

此外,如果可能的话,任何人都可以解释一下崩溃的含义吗?谢谢。

编辑我的 build.gradle 有那些

    compile 'io.reactivex:rxandroid:1.2.1'
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.4.0'
compile 'com.trello:rxlifecycle:0.6.1'
// If you want pre-written Activities and Fragments you can subclass as providers
compile 'com.trello:rxlifecycle-components:0.6.1'

compile 'com.mlsdev.rximagepicker:library:1.1.9'
compile 'com.github.zellius:rxlocationmanager:0.1.1'
compile 'com.sdoward:rxgooglemaps:1.0@aar'

最佳答案

如果您使用的是 multidex,那么也可能会出现此问题。但在较低版本的手机中。

您需要做的就是按照此处给出的步骤进行操作:

https://stackoverflow.com/a/26627133/842607

关于android - NoClassDefFoundError : rx. subscriptions.CompositeSubscription,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38713937/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com