I am trying to upload images but i keep getting TypeError: null is not an object (evaluating 'NativeModule.startUpload')
Here is what i have done
Upload.startUpload({
url: url,
path: ' file:///data/user..........',
method: 'PUT',
maxRetries: 2, // set retry count (Android only). Default 2
headers: {
'Content-Type': 'application/json',
Authorization: token,
},
notification: {
enabled: true
},
useUtf8Charset: true
}).then((uploadId) => {
console.log('upload started');
Upload.addListener('progress', uploadId, (data) => {
// Add to global state so that it can be used in other components
console.log(`Progress: ${data.progress}%`);
});
Upload.addListener('error', uploadId, (data) => {
// Add to global state so that it can be used in other components
console.log(`Error: ${data.error}%`);
});
Upload.addListener('cancelled', uploadId, (data) => {
// Add to global state so that it can be used in other components
console.log('Cancelled!');
});
Upload.addListener('completed', uploadId, (data) => {
// Add to global state so that it can be used in other components
// data includes responseCode: number and responseBody: Object
console.log('Completed!');
resolve();
});
}).catch((err) => {
console.log('Upload error!', err);
reject();
});
I am trying to upload images but i keep getting
TypeError: null is not an object (evaluating 'NativeModule.startUpload')
Here is what i have doneThis is the error i am getting _TypeError: null is not an object (evaluating 'NativeModule.startUpload') startUpload@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:208432:24 callee2$ tryCatch@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:24960:23 invoke@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25136:32 tryCatch@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:24960:23 invoke@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25036:30 http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25066:19 tryCallTwo@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:26993:9 doResolve@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27157:25 Promise@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27016:14 callInvokeWithMethodAndArg@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25065:33 enqueue@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25070:157 async@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:25087:69 tryCallTwo@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:26993:9 doResolve@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27157:25 Promise@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:27016:14 uploadImage