vinzscam/react-native-file-viewer

`new NativeEventEmitter()` warning on Android

mbuluttr opened this issue · 3 comments

Hi. I'm trying to run the usage example in the documentation and I got this warning on Android emulator and console.

"react-native": "0.66.1",
"react-native-file-viewer": "^2.1.4",
"react-native-image-crop-picker": "^0.36.4",
"react-native-document-picker": "^7.1.1",

Example 1

import FileViewer from "react-native-file-viewer";
import DocumentPicker from "react-native-document-picker";

try {
  const res = await DocumentPicker.pick({
    type: [DocumentPicker.types.allFiles],
  });
  await FileViewer.open(res.uri);
}
catch(e) {
  // error
}

Example 2

import FileViewer from "react-native-file-viewer";
import ImagePicker from "react-native-image-crop-picker";

ImagePicker.openPicker({})
  .then(image => FileViewer.open(image.path))
  .catch(error => {
    // error
  });

Console output

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

I have the same issue too, thanks for reporting it

Same here, and I have a problem not being able to see the console log, any way to solve it?

Hi, thanks for reporting the issue. This was fixed by #126 and released in v2.1.5