Thanks, but I am not able to replicate the issue anymore.
Not sure it will help, but here is what happen to me:
Had this issue after an Android Studio and an AGPlugin update, and after reading that, I've just tried a computer reboot with a clean build folder, then the error disappeared.