Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nuuk00 opened this issue Apr 5, 2024 · 2 comments

Comments

@nuuk00
Copy link

nuuk00 commented Apr 5, 2024

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?

@ThomasVuNguyen
Copy link

Hi, you might want to add network access to the app
https://stackoverflow.com/questions/55603979/why-cant-a-flutter-application-connect-to-the-internet-when-installing-app-rel

The first comment of this stack overflow should solve it

@vicajilau
Copy link
Collaborator

Can you confirm @nuuk00 if @ThomasVuNguyen solved your issue? In that case we will add it as part of our documentation 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants