Java for Android with Atlas MongoDB connection

I’m trying to connect my Android app to an Atlas shared cluster using SCRAM (i had tryied with X509 with no succes) using these code:

String ConnectionString = “mongodb://” + UserName +":" + Password + “@sales-shard-00-00.8yajj.mongodb.net:27017,” +
sales-shard-00-01.8yajj.mongodb.net:27017,sales-shard-00-02.8yajj.mongodb.net:27017/” +
DbName + “?ssl=true&replicaSet=atlas-t0tu8r-shard-0&authMethod=MONGODB-X509&authSource=admin&retryWrites=true&w=majority”;
ConnectionString _connectionString = new ConnectionString(ConnectionString);
MongoClient _client = MongoClients.create(_connectionString);
MongoDatabase _database = _client.getDatabase(DbName);
MongoCollection _collection = _database.getCollection(CollectionName);

Document sampleDoc = new Document("_id",“1”).append(“name”,“Caccola Pelosa”);
_collection.insertOne(sampleDoc);

same code in C# work perfectly and fast…with Java in android studio nothing.

can someone help me please ?

thanks

If you already inserted document with _id:1 using the C# code that works, it is normal that the other does not work because you can only have one document with the given _id.

Do you have any exception, tracing or log?

Thanks for your answer Steve…
this is whats happen when i try to insert the document

V/RenderScript: 0xaed97000 Launching thread(s), CPUs 4
I/System.out: 17:15:54.665 [main] INFO org.mongodb.driver.cluster - Cluster created with settings {hosts=[sales-shard-00-00.8yajj.mongodb.net:27017, sales-shard-00-01.8yajj.mongodb.net:27017, sales-shard-00-02.8yajj.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='atlas-t0tu8r-shard-0'}
I/System.out: 17:15:54.674 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-00.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 17:15:54.718 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-01.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 17:15:54.721 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-02.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 17:15:54.726 [main] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]
I/System.out: 17:15:54.765 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:1}
I/System.out: 17:15:54.765 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:2}
I/System.out: 17:15:54.768 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-01.8yajj.mongodb.net:27017
    com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
        at java.lang.Thread.run(Thread.java:818)
    Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
        at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
        at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
        at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
    	... 2 common frames omitted
I/System.out: 17:15:54.770 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-00.8yajj.mongodb.net:27017
I/System.out: com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
        at java.lang.Thread.run(Thread.java:818)
    Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
        at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
        at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
        at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
    	... 2 common frames omitted
I/System.out: 17:15:54.772 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]
I/System.out: 17:15:54.766 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:3}
I/System.out: 17:15:54.775 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-02.8yajj.mongodb.net:27017
    com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
        at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
        at java.lang.Thread.run(Thread.java:818)
    Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)
        at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
        at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
        at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
        at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
        at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
    	... 2 common frames omitted
I/System.out: 17:15:54.777 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]
I/System.out: 17:15:54.779 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.020 [main] INFO org.mongodb.driver.cluster - No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@947b2d7 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, ServerDescription{address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, ServerDescription{address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]}. Waiting for 30000 ms before timing out
I/System.out: 17:15:58.028 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:4}
I/System.out: 17:15:58.030 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.035 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:6}
I/System.out: 17:15:58.036 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.039 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:5}
I/System.out: 17:15:58.040 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.532 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:7}
I/System.out: 17:15:58.534 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.538 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:8}
I/System.out: 17:15:58.542 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:9}
I/System.out: 17:15:58.541 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:58.545 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:59.051 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:10}
I/System.out: 17:15:59.061 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:12}
I/System.out: 17:15:59.064 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:11}
I/System.out: 17:15:59.057 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-00.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}, {address=sales-shard-00-02.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)}}]
I/System.out: 17:15:59.070 [cluster-ClusterId{value='61cb383ace66a833af94e670', description='null'}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to  {type=REPLICA_SET, servers=[{address=sales-shard-00-01.8yajj.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters

But the URI you shared still specify

This is the connection string now:
mongodb://Username:Password@sales-shard-00-00.8yajj.mongodb.net:27017,sales-shard-00-01.8yajj.mongodb.net:27017,sales-shard-00-02.8yajj.mongodb.net:27017/Stores?ssl=true&replicaSet=atlas-t0tu8r-shard-0&authSource=admin&retryWrites=true&w=majority

and this the log
I/OpenGLRenderer: Initialized EGL, version 1.4
I/System.out: 14:18:06.666 [main] INFO org.mongodb.driver.cluster - Cluster created with settings {hosts=[sales-shard-00-00.8yajj.mongodb.net:27017, sales-shard-00-01.8yajj.mongodb.net:27017, sales-shard-00-02.8yajj.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout=‘30000 ms’, maxWaitQueueSize=500, requiredReplicaSetName=‘atlas-t0tu8r-shard-0’}
14:18:06.676 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-00.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 14:18:06.729 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-01.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 14:18:06.730 [main] INFO org.mongodb.driver.cluster - Adding discovered server sales-shard-00-02.8yajj.mongodb.net:27017 to client view of cluster
I/System.out: 14:18:06.748 [main] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=REPLICA_SET, servers=[{address:27017=sales-shard-00-01.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}, {address:27017=sales-shard-00-00.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}, {address:27017=sales-shard-00-02.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}]
I/System.out: 14:18:06.809 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:2}
I/System.out: 14:18:06.809 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:1}
I/System.out: 14:18:06.811 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.connection - Closing connection connectionId{localValue:3}
I/System.out: 14:18:06.811 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-00.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-00.8yajj.mongodb.net:27017
com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
I/System.out: at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
… 2 common frames omitted
I/System.out: 14:18:06.811 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-01.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-01.8yajj.mongodb.net:27017
com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
I/System.out: at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
… 2 common frames omitted
I/System.out: 14:18:06.813 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-00.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=REPLICA_SET, servers=[{address:27017=sales-shard-00-01.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}, {address:27017=sales-shard-00-00.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}, {address:27017=sales-shard-00-02.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}]
I/System.out: 14:18:06.815 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-02.8yajj.mongodb.net:27017] INFO org.mongodb.driver.cluster - Exception in monitor thread while connecting to server sales-shard-00-02.8yajj.mongodb.net:27017
I/System.out: com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
I/System.out: at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:138)
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)
at com.mongodb.internal.connection.SslHelper.enableHostNameVerification(SslHelper.java:64)
at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:60)
at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:128)
… 2 common frames omitted
I/System.out: 14:18:06.817 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-01.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=REPLICA_SET, servers=[{address:27017=sales-shard-00-01.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}, {address:27017=sales-shard-00-00.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}, {address:27017=sales-shard-00-02.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING}]
I/System.out: 14:18:06.823 [cluster-ClusterId{value=‘61cc600ea2f06c7d697bfe74’, description=‘null’}-sales-shard-00-02.8yajj.mongodb.net:27017] DEBUG org.mongodb.driver.cluster - Updating cluster description to {type=REPLICA_SET, servers=[{address:27017=sales-shard-00-01.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}, {address:27017=sales-shard-00-00.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}, {address:27017=sales-shard-00-02.8yajj.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}, caused by {java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of ‘javax.net.ssl.SSLParameters’ appears in /system/framework/core-libart.jar)}}]

this is what’s happen when i try to connect to Atlas

Try using the SRV style connection string.

you mean whti mongodb+srv ?? Java crash immediately…
i’m using “implementation ‘org.mongodb:mongodb-driver:3.12.1’” and java

android {
compileSdkVersion 31
buildToolsVersion “28.0.3”

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 31
    versionCode 1
    versionName "1.8"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

}

Share any error message about

ConnectionString _connectionstring = new ConnectionString(“mongodb+srv://” + UserName +":" + Password+ “@sales.8yajj.mongodb.net/” +
DbName + “?retryWrites=true&w=majority”);

this is the log
I/OpenGLRenderer: Initialized EGL, version 1.4
W/art: Unresolved exception class when finding catch block: javax.naming.NamingException
Disconnected from the target VM, address: ‘localhost:50804’, transport: ‘socket’

I am out of ideas.

Since the error seems related to SSL, I would try back the original URI (without +srv) and remove the ssl parameter.

Or upgrade the driver version.

Hi,

I am also having the same issue with Java Classes and found the best answer from here, thanks.