Reputation: 10608
Problem when connect to real iOS device using Flutter in Android Studio.
"Error connecting to the service protocol: failed to connect to http://127.0.0.1:1024"
Searched up and restart the device, switch to master channel seems not helping.
flutter doctor
shows
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76,
locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
[✓] Android Studio (version 3.6)
[✓] Connected device (1 available)
Upvotes: 2
Views: 8348
Reputation: 11457
Try these steps
lsof -nP -i4TCP:1024
This command will return:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mobiledev 18230 mauro 7u IPv4 0xbea54bcdd5cea723 0t0 TCP 127.0.0.1:1024 (LISTEN)
Kill the mobiledev with the command kill 18230
(the number PID from the process)
Hit the F5/CtrlF5 or Start Debugging/Start Without Debuggin on VS Code or Android Studio
You have it working perfectly with hot reload, debug tools (breakpoints, watch variables, etc) and DevTools.
Reference https://github.com/flutter/flutter/issues/32651
Upvotes: 0
Reputation: 127
just uninstall your already installed apk and build it again thats how i solved my error on android device
Upvotes: 0
Reputation: 479
I had this issue on my physical Android device on Mac, but performing complete restart to my Mac had solved the problem.
N.B: Disabling VPN - if you use one - may helps to solve the issue.
Upvotes: 0
Reputation: 1
I was facing the same problem, I changed my channel to dev and also ran the following commands and it solved it:
1: pod install
2: pod repo update
3: sudo gem install cocoapods
4: pod setup
Upvotes: 0
Reputation: 188
I had the same problem, i solved it by disconnecting my phone from the Wifi
Upvotes: 1
Reputation: 97
I also have faced the same error. In my case, the issue was I have pointed to a wrong source for the image to be shown in the splash screen in the XML file.
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<item>
<bitmap
android:gravity="center"
android:src="@drawable/ic_launcher_round" />
</item>
</layer-list>
Upvotes: 0
Reputation: 1
Thanks for the input:
Upvotes: 0
Reputation: 10608
open ios/Runner.xcworkspace/
, clean build dir Upvotes: 2