Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NativeScript usage of the new HttpClient - causes error? #1087

Copy link
Copy link
Closed
@RoyiNamir

Description

@RoyiNamir
Issue body actions

Currently I have a working app (Groceries app):

Using this app.module.ts file

Where this is how I use the (old) Http module :

(Although it's working) - Webstorm doesn't recognize it ( since Http is old):

image

So I've changed app.module.ts to use the new HttpClient :

via :

import {HttpClient, HttpHeaders} from "@angular/common/http";

image

  • Then I get this exception :
System.err: Caused by: com.tns.NativeScriptException: 
System.err: Calling js method onActivityResumed failed
System.err: 
System.err: **Error: Trying to link invalid 'this' to a Java object**
System.err: File: "file:///data/data/org.nativescript.Groceries/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 266, column: 35
System.err: 
System.err: StackTrace: 

Full error (in console) is here :

Question

How can I fix my code not to show this error ?

Here is the package.json file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.