Es Gibt einen Fehler aus
com.jcraft.jsch.JSchException: java.net.UnknownHostException: Host „raspberrypi.local“ konnte nicht aufgelöst werden: Keine Adresse zugeordnet Hostname
Ich bin sicher, dass der Pi online ist, da es funktioniert, wenn ich die IP-Adresse des Pi getSession(username, ip) verwende.< /p>
Code: Select all
cat /etc/resolv.conf
#Generiert von NetworkManager
Nameserver 192.168. 0.1
Code:hier
Fehlerprotokoll
Code: Select all
2025-01-07 04:13:18.484 7546-8175 System.err com.fyp.ssh W com.jcraft.jsch.JSchException: java.net.UnknownHostException: Unable to resolve host "raspberrypi.local": No address associated with hostname
2025-01-07 04:13:18.484 7546-8175 System.err com.fyp.ssh W at com.jcraft.jsch.Util.createSocket(Util.java:349)
2025-01-07 04:13:18.484 7546-8175 System.err com.fyp.ssh W at com.jcraft.jsch.Session.connect(Session.java:215)
2025-01-07 04:13:18.484 7546-8175 System.err com.fyp.ssh W at com.jcraft.jsch.Session.connect(Session.java:183)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at com.fyp.ssh.MainActivity.executeRemoteCommand(MainActivity.java:82)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at com.fyp.ssh.MainActivity$MyTask.doInBackground(MainActivity.java:60)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at com.fyp.ssh.MainActivity$MyTask.doInBackground(MainActivity.java:47)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at android.os.AsyncTask$3.call(AsyncTask.java:394)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.lang.Thread.run(Thread.java:923)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W Caused by: java.net.UnknownHostException: Unable to resolve host "raspberrypi.local": No address associated with hostname
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.net.InetAddress.getAllByName(InetAddress.java:1152)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.net.Socket.(Socket.java:218)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at com.jcraft.jsch.Util.createSocket(Util.java:343)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W ... 11 more
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at libcore.io.Linux.android_getaddrinfo(Native Method)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:73)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:202)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:73)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
2025-01-07 04:13:18.485 7546-8175 System.err com.fyp.ssh W ... 15 more