The compilation failure puzzled me for days until I remembered that share_handler referred to the receive_sharing_intent package.
Then I found this note.
Compilation problems and their fixes
Error: Application does not build after adding share extension?
Fix: Check the build settings of your share extension and remove everything that tries to import cocoapods from your main project. i.e. remove everything under Linking/Other Linker Flags.
The compilation failure puzzled me for days until I remembered that share_handler referred to the receive_sharing_intent package. Then I found this note.
Fix: Check the build settings of your share extension and remove everything that tries to import cocoapods from your main project. i.e. remove everything under Linking/Other Linker Flags.
Solved my compilation problem. For your reference