You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No static method disposed()Lio/reactivex/rxjava3/disposables/Disposable; in class Lio/reactivex/rxjava3/disposables/Disposable; or its super classes (declaration of 'io.reactivex.rxjava3.disposables.Disposable' appears in base.apk!classes3.dex)
android {
...
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin projects
kotlinOptions {
jvmTarget = "1.8"
}
}
android {
...
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// For Kotlin projects
kotlinOptions {
jvmTarget = "1.8"
}
}
------------------ 原始邮件 ------------------
发件人: "ReactiveX/RxAndroid" ***@***.***>;
发送时间: 2021年10月13日(星期三) 下午2:06
***@***.***>;
抄送: "自由 ***@***.******@***.***>;
主题: Re: [ReactiveX/RxAndroid] java.lang.NoSuchMethodError (#578)
@blankyn 升级 AGP 看看,可能太旧了
经过测试,as运行没这个问题,但是打包apk就有这个问题。rxandroid 用2.1.1的也可以,唯独升级后有问题
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
此处要改成: .addCallAdapterFactory(RxJava3CallAdapterFactory.createSynchronous()) …
------------------ 原始邮件 ------------------ 发件人: "ReactiveX/RxAndroid" @.>; 发送时间: 2021年10月13日(星期三) 下午2:06 @.>; 抄送: "自由 @.@.>; 主题: Re: [ReactiveX/RxAndroid] java.lang.NoSuchMethodError (#578) @blankyn 升级 AGP 看看,可能太旧了 经过测试,as运行没这个问题,但是打包apk就有这个问题。rxandroid 用2.1.1的也可以,唯独升级后有问题 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
------------------ 原始邮件 ------------------
发件人: "ReactiveX/RxAndroid" ***@***.***>;
发送时间: 2021年11月5日(星期五) 上午10:18
***@***.***>;
抄送: "自由 ***@***.******@***.***>;
主题: Re: [ReactiveX/RxAndroid] java.lang.NoSuchMethodError (#578)
此处要改成: .addCallAdapterFactory(RxJava3CallAdapterFactory.createSynchronous())
…
------------------ 原始邮件 ------------------ 发件人: "ReactiveX/RxAndroid" @.>; 发送时间: 2021年10月13日(星期三) 下午2:06 @.>; 抄送: "自由 @.@.>; 主题: Re: [ReactiveX/RxAndroid] java.lang.NoSuchMethodError (#578) @blankyn 升级 AGP 看看,可能太旧了 经过测试,as运行没这个问题,但是打包apk就有这个问题。rxandroid 用2.1.1的也可以,唯独升级后有问题 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
没用的,安卓部分机器有问题,我测试过,目前发现两款机器
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
I had this problem too, and finally I found the problem.
The scenario where the problem occurs is:
I have a library project and an app project, and I package the library project as an aar, and then introduce it into the app project. The library project uses the static method (disposed) of the Disposable interface of rxjava3.
The problem only occurs when aar is introduced and the app project is packaged as an apk to manually install and run to the device. If you directly depend on the library project, or run it directly with AndroidStudio (whether it is aar dependency or project dependency), there is no problem.
I found two ways to solve or circumvent this problem:
The cause of the problem lies in the process of desugaring.
When you look at the Dex file in the apk, you can find that the Disposable interface of rxjava3 will be divided into two parts, one of which is Disposable, which contains the declarations of two interface methods, and the other is Disposable$-CC , which contains all static methods. Our code calls static methods through Disposable, so the correct situation should be that when the class in our aar is converted to dex, the call to the static method needs to be replaced with Disposable$-CC.xxxx(), but when we aar is imported with (name,ext) , AGP will not do this for us.
More specific reasons require us to study the behavior of AGP or D8
Activity
huihui4045 commentedon Apr 22, 2021
huihui4045 commentedon Apr 22, 2021
huihui4045 commentedon Apr 22, 2021
JakeWharton commentedon Apr 22, 2021
blankyn commentedon Oct 9, 2021
问题解决了吗
Goooler commentedon Oct 9, 2021
blankyn commentedon Oct 13, 2021
我设置了,但是无效,依然还会报错
Goooler commentedon Oct 13, 2021
@blankyn 升级 AGP 看看,可能太旧了
blankyn commentedon Oct 13, 2021
我用的3.6.3版本
blankyn commentedon Oct 13, 2021
经过测试,as运行没这个问题,但是打包apk就有这个问题。rxandroid 用2.1.1的也可以,唯独升级后有问题
13man commentedon Oct 13, 2021
blankyn commentedon Nov 5, 2021
没用的,安卓部分机器有问题,我测试过,目前发现两款机器
13man commentedon Nov 5, 2021
hanlyjiang commentedon Mar 9, 2022
I had this problem too, and finally I found the problem.
The scenario where the problem occurs is:
I found two ways to solve or circumvent this problem:
from:
to:
implementation(files("libs/libs.aar"))gradle.propertiesandroid.enableDexingArtifactTransform.desugaring=falseThe cause of the problem lies in the process of desugaring.
When you look at the Dex file in the apk, you can find that the Disposable interface of rxjava3 will be divided into two parts, one of which is
Disposable, which contains the declarations of two interface methods, and the other isDisposable$-CC, which contains all static methods. Our code calls static methods through Disposable, so the correct situation should be that when the class in our aar is converted to dex, the call to the static method needs to be replaced withDisposable$-CC.xxxx(), but when we aar is imported with (name,ext) , AGP will not do this for us.More specific reasons require us to study the behavior of AGP or D8
hsy719007146 commentedon Apr 27, 2022
hsy719007146 commentedon Oct 11, 2022
hsy719007146 commentedon Dec 22, 2022