How can I generate R.java from this Error

I have tried severally to clean and rebuild project, but Android studio keeps giving me this error message. (Screenshots are below).
From the event log, it seems my android studio network isn’t able to connect to the URL to download the aapt2 tool. I have also tried changing the proxy network to auto-select but anytime I rebuid project my network fails to parse to host (the host name was set manually by me after installing android studio, I have now done autmatically connect to proxy),


I will be waiting on you guys for a possible solution.
Thanks.