Giter Site home page Giter Site logo

Comments (16)

denyslave avatar denyslave commented on July 16, 2024 7

Hey, I could actually found the solution in this thread:
https://stackoverflow.com/questions/45992420/speechrecognizer-bind-to-recognition-service-failed

Just add this lines to your unityLibrary/manifests/AndroidManifest.xml:
<queries>
<package android:name="com.google.android.googlequicksearchbox"/>
</queries>

from speech-and-text-unity-ios-android.

tibi321 avatar tibi321 commented on July 16, 2024 2

@tibi321 https://www.youtube.com/watch?v=Tyv3PRbe9fs You have to increase the Gradle version as shown in that video

its worked!!...thanks bro

from speech-and-text-unity-ios-android.

jayesh8585 avatar jayesh8585 commented on July 16, 2024 2

Hello All,
In android 11 we got this issue, after searching a lot we found that by adding the below lines it should work :
Error : Error SpeechRecognizer bind to recognition service failed

but our app was crashed & we got a new error please check the attached screenshot
Can anyone help us to fix it?
image_2022_05_05T13_21_56_935Z (1)

from speech-and-text-unity-ios-android.

tibi321 avatar tibi321 commented on July 16, 2024 1

The update needed is in \SpeechToText_AppleAPI\Assets\Plugins\Android\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.starseed.speechtotext" 
		  android:versionCode="1" android:versionName="1.0">
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
    <queries>
        <package android:name="com.google.android.googlequicksearchbox"/>
    </queries>
    <application 
    android:icon="@drawable/app_icon" 
    android:label="@string/app_name" android:debuggable="false"
    android:configChanges="orientation|screenSize|locale"
    android:theme="@style/UnityThemeSelector">
    <activity 
      android:name="com.starseed.speechtotext.MainActivity" 
	    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
      android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>   
  </application>
</manifest>

Hey, I could actually found the solution in this thread:
https://stackoverflow.com/questions/45992420/speechrecognizer-bind-to-recognition-service-failed

Just add this lines to your unityLibrary/manifests/AndroidManifest.xml:
<queries>
<package android:name="com.google.android.googlequicksearchbox"/>
</queries>

Hey, I could actually found the solution in this thread:
https://stackoverflow.com/questions/45992420/speechrecognizer-bind-to-recognition-service-failed

Just add this lines to your unityLibrary/manifests/AndroidManifest.xml:
<queries>
<package android:name="com.google.android.googlequicksearchbox"/>
</queries>

Due to adding these lines There is an issue during build "package key is missing"

from speech-and-text-unity-ios-android.

amromezzat avatar amromezzat commented on July 16, 2024 1

@tibi321 https://www.youtube.com/watch?v=Tyv3PRbe9fs You have to increase the Gradle version as shown in that video

from speech-and-text-unity-ios-android.

MaekellMina avatar MaekellMina commented on July 16, 2024 1

Hello All, In android 11 we got this issue, after searching a lot we found that by adding the below lines it should work : Error : Error SpeechRecognizer bind to recognition service failed

but our app was crashed & we got a new error please check the attached screenshot Can anyone help us to fix it? image_2022_05_05T13_21_56_935Z (1)

hi, did you manage to resolve this one your end? i'm facing this exact same error

from speech-and-text-unity-ios-android.

denyslave avatar denyslave commented on July 16, 2024

Hi, same problem here. In my case, I actually observed this problem on some phones with Android 10, either.
Have you found any solution?

from speech-and-text-unity-ios-android.

joepeaden avatar joepeaden commented on July 16, 2024

Same problem here. Just updated to Android 11. Seems like the MainActivity class is missing?
Here's a snapshot of the Android Logcat error that I'm getting at least.

image

from speech-and-text-unity-ios-android.

riesvriend avatar riesvriend commented on July 16, 2024

The update needed is in \SpeechToText_AppleAPI\Assets\Plugins\Android\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.starseed.speechtotext" 
		  android:versionCode="1" android:versionName="1.0">
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
    <queries>
        <package android:name="com.google.android.googlequicksearchbox"/>
    </queries>
    <application 
    android:icon="@drawable/app_icon" 
    android:label="@string/app_name" android:debuggable="false"
    android:configChanges="orientation|screenSize|locale"
    android:theme="@style/UnityThemeSelector">
    <activity 
      android:name="com.starseed.speechtotext.MainActivity" 
	    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
      android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>   
  </application>
</manifest>

from speech-and-text-unity-ios-android.

tibi321 avatar tibi321 commented on July 16, 2024

The update needed is in \SpeechToText_AppleAPI\Assets\Plugins\Android\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.starseed.speechtotext" 
		  android:versionCode="1" android:versionName="1.0">
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />
    <queries>
        <package android:name="com.google.android.googlequicksearchbox"/>
    </queries>
    <application 
    android:icon="@drawable/app_icon" 
    android:label="@string/app_name" android:debuggable="false"
    android:configChanges="orientation|screenSize|locale"
    android:theme="@style/UnityThemeSelector">
    <activity 
      android:name="com.starseed.speechtotext.MainActivity" 
	    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
      android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>   
  </application>
</manifest>

Hey, I could actually found the solution in this thread:
https://stackoverflow.com/questions/45992420/speechrecognizer-bind-to-recognition-service-failed
Just add this lines to your unityLibrary/manifests/AndroidManifest.xml:
<queries>
<package android:name="com.google.android.googlequicksearchbox"/>
</queries>

Hey, I could actually found the solution in this thread:
https://stackoverflow.com/questions/45992420/speechrecognizer-bind-to-recognition-service-failed
Just add this lines to your unityLibrary/manifests/AndroidManifest.xml:
<queries>
<package android:name="com.google.android.googlequicksearchbox"/>
</queries>

Due to adding these lines There is an issue during build "package key is missing"

how will i solve this build error

from speech-and-text-unity-ios-android.

BrockyBoi avatar BrockyBoi commented on July 16, 2024

Hi there, I seem to be having the same issues as everyone else, but the solutions don't seem to be doing anything. Regarding upgrading the gradle version, the video says to upgrade it to 3.4.3, but on the latest version of unity it's already at 4.0.1, and going backwards doesn't seem to help. I have also copy and pasted the exact xml code to AndroidManifest.xml, so I've really seemed to hit a roadblock. Right now all I'm trying to do is to run the sample scene on my android phone and not get the Error Unity java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity error. Any help would go a long ways. Thanks so much.
"

from speech-and-text-unity-ios-android.

g5fighter avatar g5fighter commented on July 16, 2024

Hi there, I seem to be having the same issues as everyone else, but the solutions don't seem to be doing anything. Regarding upgrading the gradle version, the video says to upgrade it to 3.4.3, but on the latest version of unity it's already at 4.0.1, and going backwards doesn't seem to help. I have also copy and pasted the exact xml code to AndroidManifest.xml, so I've really seemed to hit a roadblock. Right now all I'm trying to do is to run the sample scene on my android phone and not get the Error Unity java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity error. Any help would go a long ways. Thanks so much. "

#61

from speech-and-text-unity-ios-android.

jinhe1997 avatar jinhe1997 commented on July 16, 2024

I adjusted the manifests and it still does not work.
Later I found out that I checked the Release option of Minify.
After I unchecked the Minify option, it worked.

ζˆͺεœ– 2021-12-24 上午10 21 00

from speech-and-text-unity-ios-android.

DigvijaysinhGohil avatar DigvijaysinhGohil commented on July 16, 2024

After adding in menifest
<queries> <package android:name="com.google.android.googlequicksearchbox"/> </queries>

I was experiencing crash with error
2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime FATAL EXCEPTION: main 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime Process: com.starseed.speechandtext, PID: 32514 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.ArrayList.get(int)' on a null object reference 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at com.starseed.speechtotext.MainActivity$3.onResults(MainActivity.java:115) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at android.speech.SpeechRecognizer$InternalListener$1.handleMessage(SpeechRecognizer.java:459) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:106) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at android.os.Looper.loop(Looper.java:246) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:8633) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at java.lang.reflect.Method.invoke(Native Method) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) 2022-05-05 18:51:21.677 32514 32514 Error AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Then I found a comment saying to add following in menifest
<queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries>

Now, app does not crash but when ever I am trying to detect speech it says following
2022-05-05 18:18:09.511 24114 24114 Error SpeechRecognizer bind to recognition service failed

from speech-and-text-unity-ios-android.

DigvijaysinhGohil avatar DigvijaysinhGohil commented on July 16, 2024

Hello All, In android 11 we got this issue, after searching a lot we found that by adding the below lines it should work : Error : Error SpeechRecognizer bind to recognition service failed
but our app was crashed & we got a new error please check the attached screenshot Can anyone help us to fix it? image_2022_05_05T13_21_56_935Z (1)

hi, did you manage to resolve this one your end? i'm facing this exact same error

Hi, MaekellMina.
No unfortunately we haven't managed to resolve the issue from our end, we are exploring other possible solutions at this stage. Will keep you posted if we find anything useful.

from speech-and-text-unity-ios-android.

prakyath-07 avatar prakyath-07 commented on July 16, 2024

Hi,

I have found a fix for this issue. Reason for crash was in MainActivity.java

@Override
public void onResults(Bundle results) {
      ArrayList<String> text = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
     /// For some reason `text`  is null.
     UnityPlayer.UnitySendMessage("SpeechToText", "onResults", text.get(0));// this line was crashing.
}

so I added a null check like this and built a new SpeechToTextPlugin.jar

@Override
public void onResults(Bundle results) {
    ArrayList<String> text = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
    if(text!=null && !text.isEmpty())
    {   
         UnityPlayer.UnitySendMessage("SpeechToText", "onResults", text.get(0));
    }else {
        UnityPlayer.UnitySendMessage("SpeechToText", "onResults", "null recieved");
    }
}

Solution:

  1. Download and extract following zip file.
    SpeechToTextPlugin.zip
  2. Replace new SpeechToTextPlugin.jar in 'Assets\Plugins\Android' folder.

Note:

For some reason we will get result in onPartialResultsCallback not in onResultCallback.

from speech-and-text-unity-ios-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.