Binoculus / Android-SpeechRecognition

利用安卓原生语音识别功能进行语音识别,代码大部分来自CSDN,本人在上传之前做了高版本权限动态调用,使用Android Studio打开即可使用
2 stars 0 forks source link

运行时报错 #1

Open InTheClodus opened 3 years ago

InTheClodus commented 3 years ago

当前环境 jdk11 android sdk 30 android studio 4.2 报错信息:

 Process: com.example.speechrecognition, PID: 19110
    java.lang.SecurityException: Not allowed to bind to service Intent { act=android.speech.RecognitionService cmp=com.oneplus.voicewakeup/com.qualcomm.qti.sva.service.WakeupService }
        at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1859)
        at android.app.ContextImpl.bindService(ContextImpl.java:1770)
        at android.content.ContextWrapper.bindService(ContextWrapper.java:756)
        at android.speech.SpeechRecognizer.startListening(SpeechRecognizer.java:287)
        at com.example.speechrecognition.MainActivity.doSpeechRecognition(MainActivity.java:55)
        at com.example.speechrecognition.MainActivity.onClick(MainActivity.java:29)
        at android.view.View.performClick(View.java:7520)
        at android.view.View.performClickInternal(View.java:7489)
        at android.view.View.access$3600(View.java:826)
        at android.view.View$PerformClick.run(View.java:28555)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:233)
        at android.app.ActivityThread.main(ActivityThread.java:8010)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
Binoculus commented 2 years ago

emmmmmmmmmm兄弟我也帮不了你了,写这代码的时候我还年轻,我也不知道我写的啥意思了。。。。