This is an Aapt2Exception we get when we try to link two resources that are not on the same level. This happens when the Aapt2Exception indicates that the resource(s) to be linked are not on the same level.
The Aapt2Exception is an Android Exception. It’s a common problem across the Android ecosystem. However, when we try to use the Aapt2Exception for loading the resource, we get a ResourceNotFoundException.
The source code of the Aapt2Exception is here. It is probably a known bug in Aapt2.java, but it is probably something that you should try out.
The root of the problem is when you run the Aapt2Exceptions from within the Android Developer Tools (ADT). It seems that the issue occurs when we try to make a change to the resource file in the Aapt2Exceptions.txt file. We try to do something with the resource file, and it gets created, but instead of being linked, it just links to the Aapt2Exception.txt file.
Maybe the easiest fix is to rename the file from Aapt2Exceptions.txt to Aapt2Exceptions.txt.bak, and then try again.
Aapt2Exceptions.txt is a file that is automatically generated by the Aapt2 package, so it has nothing to do with the Aapt2 exceptions that are thrown inside the Android SDK.
It is possible that there is still a resource being referenced somewhere, because Aapt2 doesn’t handle everything that gets written to its file. So you would have to figure out which resource file is being referenced and rename it to Aapt2Exceptions.txt.bak.
There is no way to know what resource file is referenced. In the case of Aapt2 exceptions, the Aapt2Exception.txt.bak file is where the Aapt2 exceptions are thrown. So if you are still having Aapt2 exceptions, you need to rename the file appropriately.
The best way to do this is to look at the manifest of the project. If you see an entry for com.android.builder.internal.aapt.v2.aapt2exceptions.bak, then you can delete that entry from the manifest.