question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error on android

See original GitHub issue

TNS Version 3.4.1 Platform Android Template Angular 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/com.eventrest.mobile/files/app/tns_modules/nativescript-background-http/background-http.js:97:57)
JS:     at Object.session (file:///data/data/com.eventrest.mobile/files/app/tns_modules/nativescript-background-http/background-http.js:103:5)
JS:     at new ProfilePicPage (file:///data/data/com.eventrest.mobile/files/app/pages/profilePic/profilePic.page.js:25:37)
JS:     at createClass (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:12481:20)
JS:     at createDirectiveInstance (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:12322:37)
JS:     at createViewNodes (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:13780:53)
JS:     at createRootView (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:13669:5)
JS:     at callWithDebugContext (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:15094:42)
JS:     at Object.debugCreateRootView [as createRootView] (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:14377:12)
JS:     at ComponentFactory_.create (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:11274:46)
JS:     at ComponentFactoryBoundToModule.create (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:4061:29)
JS:     at ViewContainerRef_.createComponent (file:///data/data/com.eventrest.mobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:11471:62)
JS:     at DetachedLoader.loadWithFactory (file:///data/data/com.eventrest.mobile/files/app/tns_modules/nativescript-angular/common/detached-loader.js:41:34)
JS:     at PageRouterOutlet.activateOnGoForward (file:///data/data/com.eventrest.mobile/files/app/tns_modules/nativescript-angular/router/page-router-outlet.js:258:49)
JS:     at PageRouterOutlet.activateWith (file:///data/data/com.eventrest.mobile/files/app/tns_modules/nativescript-angular/router/page-router-outlet.js:234:14)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thiagohagycommented, Mar 28, 2019

You just need to run “tns update” , that solved for me

0reactions
westlakemcommented, Apr 16, 2019

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)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
15 common Android problems and how to fix them - CNET
A guide for troubleshooting some of the most common and frustrating error messages seen on your Android device.
Read more >
Fixed - Unfortunately, The Process com.android.phone Has ...
7 Solutions to Fix - Unfortunately, The Process com.android.phone Has Stopped · Solution 1. Reboot Phone · Solution 2. Clear App Data and...
Read more >
Why am I getting these errors in my Android phone ... - Quora
1. Empty the cache In most cases, you just need to empty the cache of the Play Store app. This is a storage...
Read more >
Error - Android Developers
Errors. ServiceConfigurationError. java.util.concurrent. Overview. Interfaces ... Dismiss Got it. public class Error extends Throwable · java.lang.Object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found