I have been on this issue for about 3days now and I have tried everything within my power.
React Native gives me the error
react-native-image-picker : NativeModule.ImagePickermanger is Null. To fix this issue, try these steps;
Run react-native link react-native-image-picker in the project root.
Rebuild and re-run the App.
When I run react-native link react-native-image-picker, I get ;
info iOS module "react-native-image-picker" is already linked
info Android module "react-native-image-picker" is already linked
When I rebuild with react-native
react-native run-android
And re-run with
npm start ( as shown on the screen),
It goes back to the original error. It is like a loop.
I am using Andrioid Emulator Nexus 7 on Ubuntu 16.04
secitons of code
import { ImagePicker } from 'react-native-image-picker';
_pickImage = () => {
const options = {
noData: true,
allowsEditing: true,
mediaTypes: "mixed",
quality: 0.5,
};
ImagePicker.launchImageLibrary(options, response => {
if (response.uri) {
let fileObj = {
key: this.state.attachments.length, //first image will have 0 here
fileInfo: response
};
this.state.attachments.push(fileObj);
this.setState((prevState) => ({
numFiles: parseInt(prevState.numFiles) + 1,
}))
}
});
};
_pickLiveImage = () => {
const options = {
noData: true,
allowsEditing: true,
mediaTypes: "mixed",
quality: 0.5,
};
ImagePicker.launchCamera(options, response => {
if (response.uri) {
let fileObj = {
key: this.state.attachments.length, //first image will have 0 here
fileInfo: response
};
this.state.attachments.push(fileObj);
this.setState((prevState) => ({
numFiles: parseInt(prevState.numFiles) + 1,
}))
}
});
};
Any help or propositions on this issue will be highly welcomed.