Hans Jamse - 2017-07-28

Hello, my Xamarin App (C#) had this error for almost 3 days now. When I do "speechrecognizer.StartListening()"

    private void switchSearch(string searchName)
    {
        speechrecognizer.StopListening();

        // If we are not spotting, start listening with timeout (10000 ms or 10 seconds).
        if (searchName.Equals(KWSS_SEARCH5))
            speechrecognizer.StartListening();
        else
            speechrecognizer.StartListening();
    }

It crashes. I debugged it and analysed where it crashes. It crashes right here, at the "JNIEnv.CallVoidMethod "

        static IntPtr id_startListening;
        // Metadata.xml XPath method reference: path="/api/package[@name='edu.cmu.pocketsphinx']/class[@name='SpeechRecognizer']/method[@name='startListening' and count(parameter)=0]"
        [Register ("startListening", "()V", "GetStartListeningHandler")]
        public virtual unsafe void StartListening ()
        {
            if (id_startListening == IntPtr.Zero)
                id_startListening = JNIEnv.GetMethodID (class_ref, "startListening", "()V");
            try {

            if (((object) this).GetType () == ThresholdType)
                //crash

          ***JNIEnv.CallVoidMethod (((global::Java.Lang.Object) this).Handle, idstartListening);***

            else
                JNIEnv.CallNonvirtualVoidMethod (((global::Java.Lang.Object) this).Handle, ThresholdClass, JNIEnv.GetMethodID (ThresholdClass, "startListening", "()V"));
        } finally {
        }
    }

Im clueless and I need your help. Thanks in advance , keep it up!

EDIT:
The ERROR Message itself

         07-28 08:13:25.385 E/mono-rt ( 4885): =================================================================
        07-28 08:13:25.385 E/mono-rt ( 4885): Got a SIGSEGV while executing native code. This usually indicates
        07-28 08:13:25.385 E/mono-rt ( 4885): a fatal error in the mono runtime or one of the native libraries 
        07-28 08:13:25.385 E/mono-rt ( 4885): used by your application.
        07-28 08:13:25.385 E/mono-rt ( 4885): =================================================================
        07-28 08:13:25.385 E/mono-rt ( 4885): 
        07-28 08:13:25.385 F/libc    ( 4885): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1c in tid 4928 (SpeechRecognize)
 

Last edit: Hans Jamse 2017-07-28