aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 549 forks source link

IOT Connection - java.lang.IllegalArgumentException: no NetworkModule installed for scheme “ssl” #3356

Closed hardikdevios closed 1 year ago

hardikdevios commented 1 year ago

Describe the bug After updating the AWS SDK Library to 2.71.0 I am getting the following exception from mqttManager?.connect() function

java.lang.IllegalArgumentException: no NetworkModule installed for scheme “ssl” of URI “ssl://xxxxxxxxxxxxxx-xxx.iot.xx-xxxx-1.amazonaws.com:8883”

Which AWS service(s) are affected? AWS IOT

Environment Information (please complete the following information):

tylerjroach commented 1 year ago

@hardikdevios This looks like it is coming from the Paho client. Can you try these proguard rules? https://github.com/eclipse/paho.mqtt.java/issues/572#issuecomment-641083671

hardikdevios commented 1 year ago

@hardikdevios This looks like it is coming from the Paho client. Can you try these proguard rules? eclipse/paho.mqtt.java#572 (comment)

Thank you, let me try it

hardikdevios commented 1 year ago

@tylerjroach Proguard rules didn't work, still getting the same error

hardikdevios commented 1 year ago

@tylerjroach Any idea, do we require any other proguard rules to get it working?

hardikdevios commented 1 year ago

@tylerjroach Any way solved the issue, so I am closing the ticket

tylerjroach commented 1 year ago

Sorry I had not gotten back to you yet but I am glad you resolved the issue. If there are any details that you can share, in case another customer runs into the same issue, it would be appreciated. Thanks!

F1nny commented 1 year ago

Thanks @tylerjroach for your help here, it appears that in the newer AWS SDK, the paho client SPI NetworkModuleFactory is now created as a service in the Android META-INF which was not the case in the prior versions (we hadn't updated since last year so was a bit of a jump). Due to some other factors our apk has to be resigned via command line which has always cleared the META-INF before resigning, and losing that service file is what caused the problem :smile: After reworking the resigning process, we're back to normal :tada: Thanks again!