WalletConnect / WalletConnectKotlinV2

WalletConnect Kotlin SDK v2
Apache License 2.0
207 stars 75 forks source link

ParametrizedType illegalArgumentException when using minify. #1056

Open jchau207 opened 1 year ago

jchau207 commented 1 year ago

Describe the bug A crash happens on CoreClient() init io runtime when minify set to true.

Caused by: java.lang.IllegalArgumentException: Receive method must return ParameterizedType: public abstract kotlinx.coroutines.flow.Flow com.walletconnect.foundation.network.data.service.RelayService.observeBatchSubscribeAcknowledgement()
                                                                                                        at com.tinder.scarlet.internal.servicemethod.ServiceMethod$Receive$Factory.create(ServiceMethod.kt:74)
                                                                                                        at com.tinder.scarlet.internal.servicemethod.ServiceMethod$Receive$Factory.create(ServiceMethod.kt:66)
                                                                                                        at com.tinder.scarlet.internal.servicemethod.ServiceMethodExecutor$Factory.toServiceMethod(ServiceMethodExecutor.kt:47)
                                                                                                        at com.tinder.scarlet.internal.servicemethod.ServiceMethodExecutor$Factory.findServiceMethods(ServiceMethodExecutor.kt:38)
                                                                                                        at com.tinder.scarlet.internal.servicemethod.ServiceMethodExecutor$Factory.create(ServiceMethodExecutor.kt:32)
                                                                                                        at com.tinder.scarlet.internal.Service$Factory.create(Service.kt:28)
                                                                                                        at com.tinder.scarlet.Scarlet.implementService(Scarlet.kt:108)
                                                                                                        at com.tinder.scarlet.Scarlet.create(Scarlet.kt:100)
                                                                                                        at com.walletconnect.android.internal.common.di.CoreNetworkModuleKt$coreAndroidNetworkModule$1$12.invoke(CoreNetworkModule.kt:124)
                                                                                                        at com.walletconnect.android.internal.common.di.CoreNetworkModuleKt$coreAndroidNetworkModule$1$12.invoke(CoreNetworkModule.kt:123)
                                                                                                        at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:52)
                                                                                                        ... 34 more

SDK Version

To Reproduce Steps to reproduce the behavior:

  1. Enable Minify
  2. Initialize CoreClient: com.walletconnect.android.CoreClient.initialize

Expected behavior No crash should happen

Device (please complete the following information):

jakubuid commented 1 year ago

Please use the newest SDK versions and check again. I've released a new version that should fix it: https://github.com/WalletConnect/WalletConnectKotlinV2#sdk-chart

jchau207 commented 1 year ago

@jakubuid

I upgraded to the Core SDK to 1.19.0 now i am getting this error:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/walletconnect/android/CoreInterface;
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.walletconnect.android.CoreInterface" on path: DexPathList[[zip file "/data/app/~~FRqX_jtH8W0PTmWeVfYwpA==/com.bitcoin.mwallet.preview-bpa-_bu1-nfdfRRptpbr3A==/base.apk"],nativeLibraryDirectories=[/data/app/~~FRqX_jtH8W0PTmWeVfYwpA==/com.bitcoin.mwallet.preview-bpa-_bu1-nfdfRRptpbr3A==/lib/arm64, /data/app/~~FRqX_jtH8W0PTmWeVfYwpA==/com.bitcoin.mwallet.preview-bpa-_bu1-nfdfRRptpbr3A==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
                                                                                                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
                                                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

with or without minify turned on.