Error: trying to link invalid 'this' to a Java object


I’m build a plugin for iBeacon scanning, the iOS doesn’t use any library and it work, for Android I need to use a library, I am using AltBeacon (that I already successfully used for another plugin I made, nativescript-virtual-ibeacon) but whenever I try to instantiate the BeaconManager it gives me the error in the Subject.

I’m using this code:

this.beaconManager = org.altbeacon.beacon.BeaconManager().getInstanceForApplication(;

Can anybody help?

You can find the plugin source code here:



Reference for anyone else that stumbles across this issue in the future:

The issue here was the BeaconManager class was static. This issue was resolved by accessing it statically instead of trying to create an empty instance of the object.

import * as utils from "utils/utils";

this.beaconManager = org.altbeacon.beacon.BeaconManager.getInstanceForApplication(;


Yes I’ve added the () by mistake! Thanks for spotting them!