After updating firebase_messaging from ^14.6.9 to ^15.0.0 and firebase_core from ^2.17.0 to ^3.0.0, the issue was resolved. There was no need to add a module interface, and the project build successfully.
firebase_messaging
^14.6.9
^15.0.0
firebase_core
^2.17.0
^3.0.0