Closed jcgoette closed 3 years ago
I pulled a logcat, looked like it failed in DNS resolution of the server on the sharing tab. Pixel 6 Pro - Android 12
11-05 22:06:45.355 29124 29156 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Failed host lookup: 'nomdebebe.hamaluik.dev' (OS Error: No address associated with hostname, errno = 7)
11-05 22:06:45.355 29124 29156 E flutter : #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:677)
11-05 22:06:45.355 29124 29156 E flutter : #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1680)
11-05 22:06:45.355 29124 29156 E flutter : #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)
11-05 22:06:45.355 29124 29156 E flutter : #3 RawSecureSocket.startConnect (dart:io/secure_socket.dart:237)
11-05 22:06:45.355 29124 29156 E flutter : #4 SecureSocket.startConnect (dart:io/secure_socket.dart:60)
11-05 22:06:45.355 29124 29156 E flutter : #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2437)
11-05 22:06:45.355 29124 29156 E flutter : #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2805)
11-05 22:06:45.355 29124 29156 E flutter : #7 _HttpClient._getConnection (dart:_http/http_impl.dart:2810)
11-05 22:06:45.355 29124 29156 E flutter : #8 _HttpClient._openUrl (dart:_http/http_impl.dart:2694)
11-05 22:06:45.355 29124 29156 E flutter : #9 _HttpClient.openUrl (dart:_http/http_impl.dart:2568)
11-05 22:06:45.355 29124 29156 E flutter : #10 IOClient.send (package:http/src/io_client.dart:30)
11-05 22:06:45.355 29124 29156 E flutter : #11 BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
11-05 22:06:45.355 29124 29156 E flutter : #12 BaseClient.get (package:http/src/base_client.dart:27)
11-05 22:06:45.355 29124 29156 E flutter : #13 get.
However, it resolves perfectly fine from an adb shell
on device
2|raven:/ $ ping nomdebebe.hamaluik.dev PING nomdebebe.hamaluik.dev (45.33.49.64) 56(84) bytes of data. 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=1 ttl=55 time=37.5 ms 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=2 ttl=55 time=103 ms 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=3 ttl=55 time=44.8 ms ^C --- nomdebebe.hamaluik.dev ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2004ms rtt min/avg/max/mdev = 37.504/61.798/103.088/29.348 ms raven:/ $
Just a little proof that its not my network messing up :) Sharing also works and resolves fine on my wife's iPhone
Obviously, the next step was to run a server to try and change the error. Got returned an EPERM (Operation not permitted) on trying to connect to my local one I set up.
11-05 22:16:50.344 29923 29954 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = 192.168.0.158, port = 8080
11-05 22:16:50.344 29923 29954 E flutter : #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:677)
11-05 22:16:50.344 29923 29954 E flutter : #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1680)
11-05 22:16:50.344 29923 29954 E flutter : #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)
11-05 22:16:50.344 29923 29954 E flutter : #3 Socket._startConnect (dart:io-patch/socket_patch.dart:1891)
11-05 22:16:50.344 29923 29954 E flutter : #4 Socket.startConnect (dart:io/socket.dart:738)
11-05 22:16:50.344 29923 29954 E flutter : #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2439)
11-05 22:16:50.344 29923 29954 E flutter : #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2805)
This leads me to notice you're (@hamaluik) missing the appropriate permissions for the app to access the network in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Edit: I didn't bother to grep, I see the android.permission.INTERNET, but not the ACCESS_NETWORK_STATE? I'm not super familiar with android permissions, so who knows....
I just built it in debug mode, works fine now on my pixel 6 pro, and in adb shell dumpsys package ca.hamaluik.nomdebebe
it shows the INTERNET permission. So I guess somewhere between debug and release mode the INTERNET permission got lost.
Well that's embarrasing. Thanks for the detective work folks, just pushed out a release which should fix this on Android.,,
Getting the "Something went wrong sharing your liked names list" error.
What can I share to help?