0

Im using react-native-permissions in ios build emulator (iphone 14 pro) but build always fails with error

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNPermissionsModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

I added
pod 'RNPermissions', :path => '../node_modules/react-native-permissions' to my Podfile but that doesn't solve my problem

soulaimane
  • 21
  • 2
  • 3

1 Answers1

0

I Foud A solution by adding

    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

    installer.pod_targets.each do |pod|
      if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
        def pod.build_type;
          # Uncomment the line corresponding to your CocoaPods version
          # Pod::BuildType.static_library # >= 1.9
          # Pod::Target::BuildType.static_library # < 1.9
        end
      end
    end
  end 

after use_frameworks! to PodFile and adding

"reactNativePermissionsIOS": [
    "LocationAccuracy",
    "LocationAlways",
    "LocationWhenInUse",
    "MediaLibrary",
    "Notifications",
    "PhotoLibrary"
  ], 

to package.json and running react-native setup-ios-permissions && pod-install

soulaimane
  • 21
  • 2
  • 3