当前环境 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)
当前环境 jdk11 android sdk 30 android studio 4.2 报错信息: