I think the problem may have something to do with adding the incorrect binding libraries in the project. I think for Android library, I should choose "Android Java Library Binding" under .NET, not "Binding Library" under General. For iOS, it may be "iOS Binding Library" under .NET, not "Binding Library" under Unified API.
With this change, I can see the library projects' csproj file contains: <TargetFramework>net7.0-android</TargetFramework> and <TargetFramework>net7.0-ios</TargetFramework> . Before this change, the csproj files' contents were quite different.
But I would like that the generated library project is based on net6.0, not net7.0, since the Maui project uses net6.0. I cannot find anywhere in the process that give me the option to choose between net6.0 and net7.0. I also tried command line in terminal, but it still gave me a project with net7.0.