-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: Cannot read property getClass of undefined #37
Comments
The plugin on npm is actually plain old JS because {N} can't run TS (it's a JS runtime). So I don't know the exact issue, but please give version 4.0.0 a try. I've just released it. Perhaps your issue was with the custom activity that had to be configured with older versions, but that has been removed because NativeScript 5.4.0 made that obsolete. |
@EddyVerbruggen I've tried the following two methods inside of my
Below is the error I receive:
|
Hi @rebz, that's because you're instantiating the plugin before the app starts (which is the last line in I will take a stab at hardening the plugin against this kind of usage. |
It did not matter where I loaded the plugin. Inside However, I no longer receive the I tried downgrading to your I'm guessing there was some update with NativeScript which is causing this issue? |
I'll continue investigating in that issue. Thx. |
Works perfectly fine on iOS, the moment I attempt to build for android the application refuses to launch. No matter how I try to import or require your package, I get the error;
Cannot read property getClass of undefined
. I saw another github issue opened for this, but no solution was made present.The only way I got it to work was by requiring the package within the script tag of a component. Unfortunately, that is not a solution as I need to access the Nfc on app load, before components load... that and I shouldn't have to limit myself to a component script tag to use a package.
I have been banging my head against a wall for days trying to get this to work. I am not using TypeScript and I see that your demo is... is there perhaps something you're doing with your build that is causing issues in non-TypeScript projects?
Unsure how to move forward.
The text was updated successfully, but these errors were encountered: