Closed anaszgh closed 6 years ago
as with the other issue of the same name, i found this to be easily resolved with a tns update
or presumably anything else that reinstalls the android platform.
Hi @anaszgh,
Is this still an issue?
@radeva Sorry, but i can't tell, because i stopped using this plugin.
You just need to run "tns update" , that solved for me
any idea what to do if it doesn't?
private async putImageToS3(signedUrl, fileLocation) {
const mimeType = mime.lookup(fileLocation);
const session = bghttp.session('image-upload');
const request: bghttp.Request = {
url: signedUrl,
method: 'PUT',
headers: {
'Content-Type': mimeType,
'Authorization': await this.cognitoService.getAccessToken()
},
description: 'Upload Image'
};
const task = session.uploadFile(fileLocation, request);
task.on('progress', progressHandler);
task.on('error', errorHandler);
task.on('responded', respondedHandler);
task.on('complete', completeHandler);
task.on('cancelled', cancelledHandler); // Android only
}
ERROR:
JS: ERROR Error: Uncaught (in promise): TypeError: Cannot set property 'NAMESPACE' of undefined
JS: TypeError: Cannot set property 'NAMESPACE' of undefined
JS: at ensureUploadServiceNamespace (file:///data/data/org.nativescript.MyProject/files/app/vendor.js:83763:57)
JS: at Function.push.../node_modules/nativescript-background-http/background-http.js.Task.create (file:///data/data/org.nativescript.MyProject/files/app/vendor.js:83815:9)
JS: at Session.push.../node_modules/nativescript-background-http/background-http.js.Session.uploadFile (file:///data/data/org.nativescript.MyProject/files/app/vendor.js:83795:21)
TNS Version 3.4.1 Platform Android Template Angular Error