I was using the target framework (Android 9) until I used a nuget package that required minimum target framework of Android 10, when I changed the target framework I was not able to archive the apk anymore. I get the following error:
Ok thanks to @ToolmakerSteve I fixed it by changing the archive directory by going to: tools >> options >> xamarin >> android settings then changes Archive location