Skip to content

SSH Connection not working in release build (apk installed on phone), but working on simulated phone in android studio. #97

@nuuk00

Description

@nuuk00

Hello,
I am new to dart/flutter programming and wanted to programm an app to connect to my raspberry pi via ssh.

void main() async {
try {
client = SSHClient(
await SSHSocket.connect(SSH_IP, 22, timeout: Duration(seconds: 10)),
username: SSH_user,
onPasswordRequest: () => SSH_password,
);
print('connection success');
state = 'connected';
runApp(MyApp());
} catch (e) {
print('connection error');
state = 'not connected';
runApp(MyApp());
}

this is my code to connect to the pi. It works on the simulated Pixel 8 Pro. But when I install it on my real phone it doesnt work. It does work when I use a dedicated app (Terminus) on the PlayStore.
Does build.gradle have something to do with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions