I tried everything suggested on here and many other sites, I eventually figured out that the problem was with Bitdefender blocking aapt....
If you have Bitdefender installed then you need to turn aapt & aapt2 "Application Access" on individually.
Hope this is of use.