Another device is using your IP address My MacBook Air (11 inch, early 2015) cannot connect to a wi-fi network. 
When I first tried, it said that it could not connect to the network since another device with the same ip address was present on it (say the address is 192.168.1.24). 

Scanning the network with another computer with arp -a (+ ifconfig | grep broadcast for the scanning computer) shows no device with the address 192.168.1.24. Pinging it gives no result either.

The default configuration for IP was "using DHCP",so I tried giving the MacBook Air a manual ip address (192.168.1.124, either with "DHCP with manual address" or "Manually") which makes it stop complaining about the ip address being in use, but it still cannot connect to the wifi. (the wifi icon is "searching", no exclamation point).

I restarted the router, and also deleted the network config files in /Library/Preferences/SystemConfiguration/:


com.apple.airport.preferences.plist
com.apple.network.identification.plist
com.apple.wifi.message-tracer.plist     
NetworkInterfaces.plist     
preferences.plist


But it is still doing the same thing.
The first step is to separate the networking configuration and IP address allocation from the WiFi connection itself.


Press option and then select the wireless icon in the menu bar (you should add it to the menu bar in network preferences while troubleshooting).
If you have BSSID / Channel / MCS and the bottom half of the details being reported, then the wireless link is up and working. If not - you have a wireless issue itself to sort out. Start the Wireless Diagnostics (option select the wireless icon in the menu bar) and work through the steps.
Once you're convinced the wireless connection is OK - then focus on the IP address / router / netmask with the goal of making the internet reachable. You might need to log in to the router as well as the wireless base station to determine correct / exact values of net mask, router and IP. Hard code those while you are testing to reduce another device spoofing your IP or squatting on your DHCP reservation as indicated by "another device is using your IP address" message. That basically means your network can't work reliably. If you need help there - use the Network Diagnostics (use spotlight to find and run it)


Basically - you don't need IP to connect to WiFi and if you're messing with IP when the WiFi isn't connected, you're chasing ghosts and not focusing on the narrow issue of the physical link in the network. For that, you might need to go within 5 feet of the device and both should get powered off for several minutes if you suspect the hardware radios are failing.