khanhuitse05 / speech-and-text-unity-ios-android

Speed to text in Unity iOS use Native Speech Recognition
MIT License
297 stars 126 forks source link

IsShowPopup bool = false crashe error #43

Open supra2 opened 3 years ago

supra2 commented 3 years ago

Hi !

On Unity2020.1.17f1, the Speechtotext functionality of the package work as intended , except for the ability to desactivate the popup display on android:

As soon as the flag is passed to false, the android build crash when calling the method Start Recording & stop recording: it seems to be provoked by the inability to cast the currentActivity to a UnityMainActivity type( the current activity seems to be the Bridge one ) .

Am I missing something in order to make this functionality work properly, or has the unity android activity evolved in some way that would create an incompatibility between the most recent version of unity & this very useful piece of code ?

Thank you for your attention , i'm looking forward to you answer !

Znoleg commented 3 years ago

Im using Unity 2021.1 and all works fine. Try to find problem on your side

brennanzdas commented 3 years ago

Hi, I am getting this same error. Unity 2020.3.11f1

AndroidJavaException: java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity java.lang.ClassCastException: com.unity3d.player.UnityPlayerActivity cannot be cast to com.starseed.speechtotext.MainActivity at com.starseed.speechtotext.Bridge.StopRecording(Bridge.java:36)

rama142694 commented 2 years ago

hey, any solution?

carlohortega commented 2 years ago

@rama142694, some are able to overcome this exception by adding the following to their AndroidManifest.xml:

`

`

See this link for details.

Isaac-dot commented 2 years ago

@carlohortega hi, i add that line to AndroidManifest.xml, but it still doesnot work with out ticking popup display on android

jeff-song1122 commented 1 year ago

still doesn't work without ticking popup display on android,any solution?

gtop79 commented 1 year ago

Hello! Any solution?

prakyath-07 commented 1 year ago

Please check https://github.com/j1mmyto9/speech-and-text-unity-ios-android/issues/58#issuecomment-1657227651 for temporary fix