Ok, so one of my co workers found the solution to this, but it's weird. So, for context we use Visual Studio for Mac so this might not be 100% compatible with Windows. The issue we found was that Visual Studio has several different views for the AndroidManifest.xml file and one of the views was modified at some point in the past.
- The default view is the UI based one with inputs and what not to help working with the file.
- The second view is when you right click the manifest file and use
OpenWith -> 'Source Code editor'
. This view is a minimalistic view of the manifest in xml that can be edited. In here you should also find the problem line about the apache library that is not in the application tag as it should be. So, you can remove it here.
- The third view is the generated manifest and can be found by following the error messages outputted by the IDE about the uses-library tag.
Manifest UI View -> Manifest intermediate xml view -> Manifest generated file
It seems that you can only modify one version of the manifest file in xml since the other will always overwrite your changes. By following the error message you only get to the final output and not the intermediary Manifest that can actually be edited and maintain its changes. There was a modification to the manifest a long time ago in our project that is just now throwing errors with the newest release of Visual Studio.
The suggested fix is to not follow the error message to open the Manifest and instead open the manifest file in xml raw. It will be a smaller file than the generated one so look for that to know you're in the right place. Remove the uses-library line that is incorrectly placed outside of the Application tag and save. Hope this helps somebody else cause it definitely caught me up for a few hours.