`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method
jeppe-smith opened this issue · 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}
/>
I am also encountering this issue. My react-native
and react-native-pdf
versions match @jeppe-smith. Commenting the component removes the error.
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
-
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
-
add the plugins in
app.json
file
{
"plugins": [
"@config-plugins/react-native-blob-util",
"@config-plugins/react-native-pdf"
]
}
- rebuild my app (in my case creating new custom build with
eas build
)
everything worked again without any errors or issues 👍