问题
I get this error while "Connect via network" option in new version of XCode9 and iOS11.
I checked the "Connect via network" box. After few seconds XCode gives me this error:
"An error was encountered while attempting to communicate with this device"
Anyone facing the same issue?
current configuration
- XCode Version 9.0 beta 5 (9M202q)
- iOS Beta 5
- iPad Air
回答1:
I found that error causes when device lost connection for a moment. it's happen when you have damaged (or very old) cable. How ironic... trying to connect a device for ones for been wireless anymore, but cable...
回答2:
I got same error in my case Quit Xcode after that restart clean and build its working fine .
回答3:
I tried rebooting laptop, xcode but, it worked by cleaning and building the app multiple times(in my case- 4 times).
回答4:
There might be more than one reason for this error:
"An error was encountered while attempting to communicate with this device. (The service is invalid.)"
I hit this problem today after I transferred my iPad XCode project from one Mac to another. I was pretty sure there was nothing wrong with my USB cable, it was working just fine on the other Mac with the same iPad.
So I did the old XCode standby voodoo solution:
- in XCode, do a
Product->Clean Build Folder
; - quit XCode;
- from the macOS Finder, delete the
DerivedData
folder for the project; - launch XCode, rebuild and run.
It works just fine now.
回答5:
All I did was unplug the charger from the phone and replugged it back in. This solved it for me.
来源:https://stackoverflow.com/questions/45587463/an-error-was-encountered-while-attempting-to-communicate-with-this-device