Why does the Kivy app crash on my phone when using boto3, paramiko?

I have a small application that sends a command to AWS EC2, and runs code on it. Created applications on the Xubuntu VM using python 3.6. Everything works fine on Windows. I also managed to build other applications with Kivy and KivyMD on this VM. When using the code and dependencies below, my app builds successfully, but when I click on the icon on my smartphone, it crashes.

Here is part of my spec file.

source.include_exts = py,png,jpg,kv,atlas
requirements = kivy==1.11.1, kivymd, boto3, botocore, openssl, paramiko, urllib3, s3transfer, ecdsa
android.permissions = INTERNET,ACCESS_NETWORK_STATE

My code:

from kivy.lang import Builder
from kivymd.app import MDApp
import kivy
import boto3
import paramiko
import io
kivy.require('1.11.1')

KV = '''
Screen:
    MDRoundFlatIconButton:
        id: button
        text: "Start"
        font_size: "18sp"
        pos_hint: {"center_x": 0.5, "center_y": 0.15}
        on_release: app.start()

'''

class MainApp(MDApp):
    def build(self):
        return Builder.load_string(KV)

    def start(self):
        def lambda_handler():

            client = boto3.client('ec2', aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key,
                                  region_name='us-east-2')

        describeInstance = client.describe_instances()

        private_key_file = io.StringIO()
        private_key_file.write('key')
        private_key_file.seek(0)
        # reading pem file and creating key object
        key = paramiko.RSAKey.from_private_key(private_key_file)

            ssh_client = paramiko.SSHClient()

            ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

            ssh_client.connect(hostname="18.18.18.18", username="ubuntu", pkey=key)

            commands = [
                "python3 /home/ubuntu/server.py 'text'",
            ]

            print("Starting execution")
            for command in commands:
                print("Executing command: " + command)
                stdin, stdout, stderr = ssh_client.exec_command(command)
                print(stdout.read())
                print(stderr.read())

            print("finished execution")

        lambda_handler()

MainApp().run()

If you reschedule import boto3 import paramiko in the function, everything starts, but if you click on the button that calls the function where these imports are involved, the application crashes

log file