[iOS] Unity 2019.3.0b11 – PBXProject.GetUnityTargetName() is deprecated.

Welcome! Forums Unity Plugins Mobile Speech Recognizer [iOS] Unity 2019.3.0b11 – PBXProject.GetUnityTargetName() is deprecated.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1849
    Senthamizh
    Participant

    After upgrading to the Unity 2019.3.0f11 I’ve come to know that the PBXProject.GetUnityTargetName() is deprecated. This results in Build error. I’ve tried with the given alternatives like PBXProject.GetUnityMainTargetGuid() & PBXProject.GetUnityFrameworkTargetGuid(). It didn’t work. Xcode 11.2.1 keeps throwing this error.

    Error in Xcode 11.2.1

    • This topic was modified 1 year, 11 months ago by Senthamizh.
    #1852
    Senthamizh
    Participant

    I tried changing the line 27 to string projectTarget = proj.TargetGuidByName(“Unity-iPhone”); directly. And this is what I’ve got.

    Unity's Console while building it

    #1855
    PiotrPiotr
    Keymaster

    Hi,
    It seems your project isn’t linked against Speech framework.

    Open xcode project, select your target, go to “Build Phases”, “Link Binary With Libraries”, click on a plus icon in bototm left and add “Speech” framework.

    #1864
    Senthamizh
    Participant

    Hi,
    I’ve added the Speech framework in Xcode as you said and I still get the same error.

    I’m guessing the problem is with the
    "KKAddSpeechFrameworkOniOS" script.

    I’ve tried using the

    PBXProject.GetUnityMainTargetGuid();

    &

    PBXProject.GetUnityFrameworkTargetGuid();

    instead of

    PBXProject.GetUnityTargetName

    at

    string targetName =

    and found by logging that

    string projectTarget = proj.TargetGuidByName

    returns Null value for both. But Build success with exception error. (In Unity only).

    Removing the entire asset files and tried. Unity and Xcode builds without any issue.

    Using the plugin is causing the issue. You probably need to update the asset maybe?

    my current setup.

    Unity 2019.3.0b11
    Xcode Version 11.2.1 (11B500)

    #1865
    PiotrPiotr
    Keymaster

    I am not sure why Unity broke this API, but as a workaround you can simply go to KKAddSpeechFrameworkOniOS.cs and set shouldRun to false.

    Then add Speech framework manually as I described above.

    #1866
    Senthamizh
    Participant

    Yeah I’ve tried what you said exactly and again it get build errors.

    I’m attaching the them. Please check. Thanks.

    shouldRun set to false.

    Build succeeded with Exception.

    Error in Xcode 11.2.1

    Added Speech.framework manually.

    #1868
    PiotrPiotr
    Keymaster

    Regarding screenshot from Unity about PBXProject.TargetGuidByName error – this is coming from UnityAdsEditor, not Speech Recognizer – it seems Unity broke their own plugin with this API change, you probably should file a bug for them 🙂

    Regarding xcode – not sure where you added, but there’s no way your project would have only one framework linked against. It should look like that:

    • This reply was modified 1 year, 11 months ago by PiotrPiotr.
    • This reply was modified 1 year, 11 months ago by PiotrPiotr.
    • This reply was modified 1 year, 11 months ago by PiotrPiotr.
    • This reply was modified 1 year, 11 months ago by PiotrPiotr.
    #1917
    PiotrPiotr
    Keymaster

    This issue is fixed in latest version.

    #1920
    Senthamizh
    Participant

    Great! Thanks, I will try it now. 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.