react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.33k stars 434 forks source link

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. #677

Closed atiqulislamwb closed 3 months ago

atiqulislamwb commented 10 months ago

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.

jesushd103 commented 10 months ago

same here! any solution?

vonovak commented 10 months ago

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 🙂

atiqulislamwb commented 10 months ago

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

HyperNovax commented 9 months ago

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.

gegana commented 9 months ago

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);
    }
  };
});
tahahaz1374 commented 9 months ago

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

sekoyo commented 8 months ago

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

ArturoLlC commented 7 months ago

Same error here on android

LushawnDev commented 6 months ago

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!

chulphan commented 5 months ago

Build on XCode, it has worked for me.

vonovak commented 3 months ago

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!