react-native-documents / document-picker

Document Picker for React Native

Home Page:https://react-native-documents.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this package support mac os react native? invariant violation: turbomoduleregistry.getenforcing(...): 'rndocumentpicker' could not be found. verify that a module by this name is registered in the native binary.

atiqulislamwb opened this issue · comments

when i install this package , then build mac os app . after image or file pick button press give me error ""invariant violation: turbomoduleregistry.getenforcing(...): 'rndocumentpicker' could not be found. verify that a module by this name is registered in the native binary.

commented

same here! any solution?

Hello and thanks for asking,
macOS is not officially supported but if you want to, you can contribute and maintain the macOS part.
Thank you 🙂

so a person wants to build a Mac OS app, how he/she could pick files (like image, video) from a Mac device?

I have the same error on Android when I update the package from 8.0.0 to the last version.
Error appears when I start jest test.

I'm not knowledgable with how TurboModules work. I use this mock taken from another thread to unblock my Jest tests.

jest.mock("react-native/Libraries/TurboModule/TurboModuleRegistry", () => {
  const turboModuleRegistry = jest.requireActual("react-native/Libraries/TurboModule/TurboModuleRegistry");
  return {
    ...turboModuleRegistry,
    getEnforcing: name => {
      if (name === "RNDocumentPicker") {
        return null;
      }
      return turboModuleRegistry.getEnforcing(name);
    }
  };
});

I have same Issue when upgrading to latest version and running android 😑
any solution?

I'm not knowledgable with how TurboModules work. I use this mock taken from another thread to unblock my Jest tests.

jest.mock("react-native/Libraries/TurboModule/TurboModuleRegistry", () => {
  const turboModuleRegistry = jest.requireActual("react-native/Libraries/TurboModule/TurboModuleRegistry");
  return {
    ...turboModuleRegistry,
    getEnforcing: name => {
      if (name === "RNDocumentPicker") {
        return null;
      }
      return turboModuleRegistry.getEnforcing(name);
    }
  };
});

This happened since v9 running Jest and this fixed it thanks

Same error here on android

For people running into the Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNDocumentPicker' could not be found error on Android, here's a fix that worked for me.

  1. Remove the package to start with: npm remove react-native-document-picker
  2. Install version 8.0.0 npm install react-native-document-picker@8.0.0

Preliminary but this has worked for me. Good luck!

Build on XCode, it has worked for me.

Closing, as mac os support is on the roadmap: https://react-native-documents.github.io/docs/sponsor-only/roadmap-and-changelog

and partly it's a duplicate of #702

Thank you!