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

IllegalAccessError: FlowableDoOnLifecycle: 2.2.3 #579

Closed
otto-25 opened this issue Apr 6, 2021 · 1 comment
Closed

IllegalAccessError: FlowableDoOnLifecycle: 2.2.3 #579

otto-25 opened this issue Apr 6, 2021 · 1 comment

Comments

@otto-25
Copy link

otto-25 commented Apr 6, 2021

App's Config:
minSdkVersion 21
targetSdkVersion 29

I am getting the following crash only for the release versions of my app in Firebase:

Illegal class access: 'io.reactivex.internal.operators.flowable.e$a' attempting to access 'io.reactivex.internal.functions.Functions$d' (declaration of 'io.reactivex.internal.operators.flowable.e$a' appears in base.apk!classes2.dex)

I get this crash on subscribe method call while trying to create a flowable for uploading image to the server in Android, i.e. :

compositeDisposable.add(createFlowable(accessToken, multipartBodyPart, imageUploadForAuditRequestBody)
.subscribeOn(schedulerProvider.io())
.debounce(200, TimeUnit.MILLISECONDS)
.observeOn(schedulerProvider.ui())
.doOnSubscribe { mvpView.showLoading("Uploading image...") }
.subscribe( // Crashing here
{
// do something
},
{ throwable: Throwable? ->
// do something
}
))

private fun createFlowable(accessToken: String, multipartBodyPart: MultipartBody.Part, imageUploadForAuditRequestBody: MutableMap<String, RequestBody>): Flowable {
return Flowable.create(
{ emitter: FlowableEmitter ->
try {
val response = RestClient.getRestClient().get().onFileUpload(
"Bearer " + accessToken,
imageUploadForAuditRequestBody, multipartBodyPart).blockingGet()
emitter.onNext(response)
} catch (e: Exception) {
Timber.e("Exception %s", e.localizedMessage)
emitter.tryOnError(e)
}
}, BackpressureStrategy.LATEST)
}

Please refer the following stack trace:
Fatal Exception: java.lang.IllegalAccessError: Illegal class access: 'io.reactivex.internal.operators.flowable.e$a' attempting to access 'io.reactivex.internal.functions.Functions$d' (declaration of 'io.reactivex.internal.operators.flowable.e$a' appears in base.apk!classes2.dex)
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle$SubscriptionLambdaSubscriber.request(FlowableDoOnLifecycle.java:101)
at io.reactivex.internal.subscribers.LambdaSubscriber.request(LambdaSubscriber.java:114)
at io.reactivex.internal.operators.flowable.FlowableInternalHelper$RequestMax.accept(FlowableInternalHelper.java:220)
at io.reactivex.internal.operators.flowable.FlowableInternalHelper$RequestMax.accept(FlowableInternalHelper.java:216)
at io.reactivex.internal.subscribers.LambdaSubscriber.onSubscribe(LambdaSubscriber.java:52)
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle$SubscriptionLambdaSubscriber.onSubscribe(FlowableDoOnLifecycle.java:73)
at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.onSubscribe(FlowableObserveOn.java:294)
at io.reactivex.subscribers.SerializedSubscriber.onSubscribe(SerializedSubscriber.java:70)
at io.reactivex.internal.operators.flowable.FlowableDebounceTimed$DebounceTimedSubscriber.onSubscribe(FlowableDebounceTimed.java:78)
at io.reactivex.internal.operators.flowable.FlowableSubscribeOn.subscribeActual(FlowableSubscribeOn.java:46)
at io.reactivex.Flowable.subscribe(Flowable.java:14805)
at io.reactivex.internal.operators.flowable.FlowableDebounceTimed.subscribeActual(FlowableDebounceTimed.java:45)
at io.reactivex.Flowable.subscribe(Flowable.java:14805)
at io.reactivex.internal.operators.flowable.FlowableObserveOn.subscribeActual(FlowableObserveOn.java:56)
at io.reactivex.Flowable.subscribe(Flowable.java:14805)
at io.reactivex.internal.operators.flowable.FlowableDoOnLifecycle.subscribeActual(FlowableDoOnLifecycle.java:38)
at io.reactivex.Flowable.subscribe(Flowable.java:14805)
at io.reactivex.Flowable.subscribe(Flowable.java:14742)
at io.reactivex.Flowable.subscribe(Flowable.java:14661)
at com.yulu.ops.yuzenapp.newYuzen.ui.audit.AuditPresenter.uploadImageForAuditFailData(AuditPresenter.java:77)

Since my app targets min SDK of 21, I believe multidex is automatically enabled.
Note: I added MultiDex.install(this) in my Application class as well but the issue persists.

@JakeWharton
Copy link
Member

Dupe of ReactiveX/RxJava#7221

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

2 participants