EddyVerbruggen / nativescript-speech-recognition

:speech_balloon: Speech to text, using the awesome engines readily available on the device.
Other
90 stars 21 forks source link

Error in demo #25

Closed ExcelNet-Public closed 5 years ago

ExcelNet-Public commented 5 years ago

Nativescript 5.2.3 trying to run Javascript demo code and get:

nativeException: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.PackageManager android.content.Context.getPackageManager()' on a null object reference

when trying to run the available() call which was discovered with a catch after the then. Nothing else going on, about as basic as can be.

I wanted to confirm the issue was not running in an emulator which we typically use for development so attached my S9 and same thing.

How can this be resolved? Thanks!

ExcelNet-Public commented 5 years ago

Leaving this for somebody else that runs into this issue to find. I was running the code too early in the Nativescript application startup and that caused the error. This was a Nativescript-Vue application and it was before the $start(). Moving the code int the created() for the initial component resolved the error above!

wa05 commented 4 years ago

@ExcelNet-Public @EddyVerbruggen Can we use this plugin with Nativescript-Vue without problems ?