react-native-share-menu icon indicating copy to clipboard operation
react-native-share-menu copied to clipboard

No such module 'RNShareMenu'

Open Larens94 opened this issue 2 years ago • 12 comments

hi, i find this error on xcode, how can i fix it?

Schermata 2021-08-02 alle 11 03 55

Larens94 avatar Aug 02 '21 09:08 Larens94

Same problem.

aliosmankepir avatar Aug 21 '21 22:08 aliosmankepir

same issue, couldn't find a workaround

sospedra avatar Aug 27 '21 09:08 sospedra

The issues seems to come from misaligned Deployment Target.

Those 4 needs to match:

  • App target
  • App Project
  • ShareExtension target
  • Podfile platform :ios, '11.0'
Capture d’écran 2021-09-09 à 14 22 48 Capture d’écran 2021-09-09 à 14 22 30

HugoGresse avatar Sep 09 '21 12:09 HugoGresse

Mine are all on 11.0 and this doesn't seem to resolve this issue.

callaars avatar Sep 14 '21 14:09 callaars

Mine are all on 11.0 and this doesn't seem to resolve this issue.

did you check all 4?

HugoGresse avatar Sep 14 '21 14:09 HugoGresse

Yes, but for me, I just checked it was the Podfile not being correct. A recent git merge removed the additional code for me. I'm referring to this:

  post_install do |installer| react_native_post_install(installer)

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
      end
    end
  end
end

target 'SHARE_EXTENSION' do
  use_react_native!(
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )

  pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
  # Manually link packages here to keep your extension bundle size minimal
end

This is resolved for me :)

callaars avatar Sep 14 '21 14:09 callaars

I fixed this after a full day of searching on a Mac M1:

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '$(inherited)'
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
      end
    end
  end

lukebrandonfarrell avatar Dec 01 '21 18:12 lukebrandonfarrell

Hi all I've tried all the workarounds here, and none work, I'm still stuck without being able to build with the same error as the OP

/.../node_modules/react-native-share-menu/ios/ReactShareViewController.swift:10:8: error: no such module 'RNShareMenu'
import RNShareMenu
       ^

This is the case when building with the command line as well as building within XCode

Any hints ?


Xcode: 13.3.1 M1 Pro

tchapi avatar Apr 15 '22 12:04 tchapi

Increasing deployment targets to 11.0 on both the main project AND the share extension finally worked for me

i6mi6 avatar May 06 '22 11:05 i6mi6

I have this problem too on last 6.0.0 image

<unknown>:0: error: module map file '/Users/username/Library/Developer/Xcode/DerivedData/Projectname-fstvewgwphvmyzbeiiueojksdirp/Build/Products/Debug-iphoneos/RNShareMenu/RNShareMenu.modulemap' not found
Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit code to indicate failure

Solution: I find my mistake open *.xcodeproj, but need *.xcworkspace :-)

anatooly avatar Aug 18 '22 20:08 anatooly

Unfortunately nothing helped so far for me. I was able to resolve "No such module 'RNShareMenu' " error by starting Xcode with "Rosetta".

But I still receive the two errors: "RNShareMenu.modulemap'" not found and "Command SwiftGeneratePch emitted errors but did not return a nonzero exit code to indicate failure".

Does someone has any idea?

IOS 13.0.1 Xcode 14.1 M1 Pro

Thanks in advance

viktorRot avatar Nov 29 '22 22:11 viktorRot

Same issue, any solution yet?

aw-geoop avatar Dec 01 '23 01:12 aw-geoop