Stopped working on Unity 2018.3+

Welcome! Forums Unity Plugins Mobile Speech Recognizer Stopped working on Unity 2018.3+

This topic contains 7 replies, has 3 voices, and was last updated by  larryapple 1 month, 4 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1400

    jphales
    Participant

    Upon upgrading to Unity 2018.3+, the plugin no longer functions. Although the android manifest is the same and the line:
    <uses-permission android:name=”android.permission.RECORD_AUDIO” />
    When installing the app on android, it no longer asks for “permission to record audio” and plugin doesn’t work.
    Haven’t checked iOS.
    Up to ~ 2018.2.6 it was fine.
    Does this have to do with Unity now packaging their own android sdk now?

    Stumped and really need help please.
    Thanks!
    Jon

    #1401
    Piotr
    Piotr
    Keymaster

    What do you mean by “own android sdk”?

    Are you using runtime permissions?
    https://docs.unity3d.com/Manual/android-RequestingPermissions.html

    #1403

    jphales
    Participant

    Thanks for the very quick response.
    Sorry, I meant the new “embedded JDK”

    I’m not using runtime permissions. Usually the app simply requests permission to use audio on install because of the permissions line in the android manifest – and it’s no longer doing so.

    I guess I can give the runtime permissions a try. I would just prefer the permissions popup on install.

    I’ll give it a try.

    #1404

    jphales
    Participant

    So, yes,

    Thanks for the response. I’m glad the plugin works, but for me was a pain to deal with permissions at runtime. Would much rather prefer on install. Don’t know why it changed.

    Thanks for your help!
    Jon

    #1405
    Piotr
    Piotr
    Keymaster

    Ask Google 🙂
    They changed it starting from Android 6.
    https://developer.android.com/guide/topics/permissions/overview

    #1423

    larryapple
    Participant

    Do you have a suggestion of how to go about requesting permission at run time?

    #1424

    jphales
    Participant

    Hi larryapple!
    It’s simple enough. You can take a look at the Unity link above.
    You can do it as needed, or even simply at the start of your app by dropping the following in a script.

    Make sure you’re at the top you are :
    #if PLATFORM_ANDROID
    using UnityEngine.Android;
    #endif

    And then, in any function, could even be in your start function include:
    #if PLATFORM_ANDROID
    if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
    {
    Permission.RequestUserPermission(Permission.Microphone);
    }
    #endif

    That should bring up the default android permission dialogue.

    #1425

    larryapple
    Participant

    Hi jphales!

    Thank you so much for the solution! Works great!

    Larry

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.