react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method

Open jeppe-smith opened this issue 1 year ago • 2 comments

What react-native version are you using? 0.74.5 What react-native-pdf version are you using? 6.7.5 What platform does your issue occur on? (android/ios/both) ios Describe your issue as precisely as possible : I have upgraded a project from 73 to 74 bridge less and now this error is showing in my logs. I have pinned it down to this library. When I remove the import of react-native-pdf I don't get the warning. Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

<Pdf
        trustAllCerts={false}
        source={source}
        onLoadComplete={(numberOfPages, filePath) => {}}
        onPageChanged={(page, numberOfPages) => {}}
        onError={(error) => {}}
        onPressLink={(uri) => {}}
        style={styles.pdf}
/>

jeppe-smith avatar Aug 12 '24 06:08 jeppe-smith

I am also encountering this issue. My react-native and react-native-pdf versions match @jeppe-smith. Commenting the component removes the error.

SwhiteMHC avatar Aug 20 '24 21:08 SwhiteMHC

I hade the same error message. I am using Expo in my project with the same package versions you described.

in my case after following the documentation instructions described in config-plugins/react-native-pdf repo: https://github.com/expo/config-plugins/tree/main/packages/react-native-pdf

  1. install all the required packages npx expo install react-native-pdf react-native-blob-util @config-plugins/react-native-pdf @config-plugins/react-native-blob-util

  2. add the plugins in app.json file

{
  "plugins": [
    "@config-plugins/react-native-blob-util",
    "@config-plugins/react-native-pdf"
  ]
}
  1. rebuild my app (in my case creating new custom build with eas build)

everything worked again without any errors or issues 👍

RaafatDev avatar Sep 24 '24 00:09 RaafatDev

I also don't get it to work, trying for some hours already 😞 The error keeps showing on iOS.

"@config-plugins/react-native-blob-util": "^9.0.0",
"@config-plugins/react-native-pdf": "^9.0.0",
"expo": "^52.0.24",
"react-native": "0.76.5",
"react-native-blob-util": "^0.19.11",
"react-native-pdf": "^6.7.6",

pfleigo avatar Jan 10 '25 13:01 pfleigo

Hi, We are also facing the same issue, did anyone find a way to fix or workaround?

"react-native": "0.80.1", "react-native-pdf": "^6.7.7", "react-native-blob-util": "^0.22.2",

I have also tried @RaafatDev 's solution, but i didn't work for us:

"@config-plugins/react-native-blob-util": "^11.0.0", "@config-plugins/react-native-pdf": "^11.0.0",

Thanks

logesh2496 avatar Jul 15 '25 05:07 logesh2496