Those who experienced the error "IP address could not be retrieved" on Android are not alone. It seems to bother users of all Android phones and software versions. We will tell you why you get the annoying error and how you can fix it.
Why am I getting the error "Error getting IP address"?
The error "Error getting IP address" is usually displayed when accessing a Wi-Fi network, regardless of whether it is new or saved on your device. This error message means that the router can not assign an IP address to your device. As long as the problem persists, the user can not access the Internet over this Wi-Fi network.
Some users experience this error message differently. It can be displayed as "get IP address" but the problem is the same.
How do I fix the error "IP address could not be retrieved"?
It's hard to say why this happens, but with the following tricks you can try to get your internet connection up and running.
The first method you should try is to forget the network and log in again. The steps are simple and sometimes this is enough to eliminate the discrepancy "IP address could not be retrieved".
- Open the app settings.
- Select "Network & Internet".
- Select "Wi-Fi. "
- Long press on the network you can not connect to.
- Select "Forget network".
- Log in to the Wi-Fi network again.
Restart the router. 
If the phone is not the problem, it could be the router. Try to restart it and see if it fixes it. Most routers have a reset button. You can also disconnect and plug it in again.
Rename Your Android Device
We're not sure why this would help, but many users claim that it solves the problem. The process is easy too, so try it.
- Open the app settings.
- Select "By Phone".
- Tap Device Name.
- Change the name to any name and choose "OK."
- Try to reconnect to the router.
Enabling and Disabling Airplane Mode
When you do this, the router must reconfigure your connection. Turn on airplane mode, and then turn it on again.
Use WPA2-PSK Encryption
Some devices work with certain not-so-good encryption types, including AES and TKIP. Go to your router settings and switch to WPA2-PSK.
Is the MAC filter enabled?
WLAN administrators often use MAC addresses to whitelist or blacklist devices on their network. This means that your device can not connect if it is not on the whitelist or on the blacklist. The solution would be to either turn off your router's MAC filter, remove your device from the blacklist, or add it to the whitelist.
Assign a static IP address
- Open the App Settings.
- Select "Network & Internet. "
- Select" Wi-Fi ".
- Long press on the network to which you can not connect.
- Select "Change Network."
- Select "Show advanced options".  Search for "IP Settings" and select "Static".
- Change the last number in the IP address to any number between one and 225.
- Try to connect.
Deleting the Google Play Services cache
This method appears to be involved in every troubleshooting process and is because so many things have to do with your phone. Rebooting the app from scratch can solve a variety of problems.
- Open the Settings app.
- Select "Apps & Notifications."
- Find and tap "Google Play Services."
- Select "Memory."
- Select "Clear cache."
- Try connecting to Wi-Fi again.
If all else fails and the problem persists for a long time, you might want to This will erase everything in your phone and restore it to its factory state (software-based) Back up any important files before proceeding.
- Open the App Settings.  Select "System."
- Select "Advanced Options."
- Select "Reset Options."
- Select "Clear all data (factory reset). "
- Select" Reset phone ".
With one of these fixes, you should be up and running in no time or in no time. Did any of you try other methods? We would like to hear from you.