dialogflow / dialogflow-android-client

Android SDK for Dialogflow
https://dialogflow.com
Apache License 2.0
574 stars 270 forks source link

Unable to pause activity in sample code {ai.api.sample/ai.api.sample.AIServiceSampleActivity} #69

Open prince-m-kumar opened 7 years ago

prince-m-kumar commented 7 years ago

I try to run sample code but its crashing due to services. 10-12 12:24:15.880 30188-30188/ai.api.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: ai.api.sample, PID: 30188 java.lang.RuntimeException: Unable to pause activity {ai.api.sample/ai.api.sample.AIServiceSampleActivity}: java.lang.IllegalArgumentException: Service not registered: android.speech.SpeechRecognizer$Connection@262d91c7 at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3504) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3459) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3434) at android.app.ActivityThread.access$1000(ActivityThread.java:178) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5624) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754) Caused by: java.lang.IllegalArgumentException: Service not registered: android.speech.SpeechRecognizer$Connection@262d91c7 at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1068) at android.app.ContextImpl.unbindService(ContextImpl.java:1929) at android.content.ContextWrapper.unbindService(ContextWrapper.java:551) at android.speech.SpeechRecognizer.destroy(SpeechRecognizer.java:408) at ai.api.services.GoogleRecognitionServiceImpl.clearRecognizer(GoogleRecognitionServiceImpl.java:141)