Chrome Custom Tabs,java.lang.IllegalStateException: setPackageName must be called before bindSessionToPostMessageService
In my project, I use Chrome Custom Tabs and expect to establish communication through requestPostMessageChannel, but when executing this line of code, an error occurs: java.lang.IllegalStateException: setPackageName must be called before bindSessionToPostMessageService. After tracing the code, the problem seems to arise when executing this.mRemote.transact(11, _data, _reply, 0). This error only occurs in this project; other projects run smoothly. I have tried many methods but cannot solve the issue.
My gradle version is 7.5, agp is 7.4.2, and browser is 1.8.0.