[UWP] Timers does not exist in the namespace System

MRCalderon3D
edited November 2017 in Photon Voice
Hi there,

Im getting 2 errors when try to build for UWP.


Assets\Plugins\PhotonVoiceApi\Core\AudioUtil.cs(560,61): error CS0234: The type or namespace name 'Timers' does not exist in the namespace 'System' (are you missing an assembly reference?)

Assets\Plugins\PhotonVoiceApi\Core\AudioUtil.cs(543,20): error CS0234: The type or namespace name 'Timers' does not exist in the namespace 'System' (are you missing an assembly reference?)


I created a new proyect in Unity 2017.2.0f3
Imported Photon PUN+ 1.87
Imported Photon Voice 1.13
Changed to UWP
Changed the Scripting Backend to .NET
Activate Capabilities for Microphone, InternetClient, InternetClientServer, PrivateNetworkClientServer

In unity editor works great but when I try to build the solution, I get those errors.

Thanks!



Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited November 2017
    Hi @MRCalderon3D,

    Thank you for choosing Photon and I apologize for the inconvenience.

    While I'm working on making a successful UWP build.

    About the two errors, here is an updated AudioUtil.cs file that you can overwrite in your project.
    We used System.Timers.Timer in AudioUtil which is not available for WSA/UWP builds. So I replaced it with Windows.System.Threading.ThreadPoolTimer for NETFX_CORE.

    I'm sorry to say that you may also stumble upon other issues.
    Here is what you may need to do (it may not be all):

    - You can remove "Assets\Plugins\PhotonVoiceApi\Platforms\Unity\AndroidAudioInAEC.cs".
    - "Assets\Plugins\WSA\x86\opus_egpv" should have platform "WSAPlayer" only and CPU: "X86".
    - "Assets\Plugins\WSA\x64\opus_egpv" should have platform "WSAPlayer" only and CPU: "X86_64".
    - Set target from Unity Inspector of "Assets\Plugins\AudioIn.bundle" and "Assets\Plugins\libspeexdsp.bundle" and "Assets\Plugins\opus_egpb.bundle" to "Standalone" and "Editor" only and OS: "OSX".
    - All files under "Assets\Plugins\x86" should have platforms "Standalone" and "Editor" only and CPU: "X86".
    - All files under "Assets\Plugins\x86_64" should have platforms "Standalone" and "Editor" only and CPU: "X86_64".
  • Thank you very much, I made a workaround using System.Threading.Timer but didn't work on Master build (I dind't try another build option).

    Using your fix works in Debug and Release builds for UWP, It donesn't work on Master but it is enought for me to continue developing a demo for Mixed Reality Headsets untill you make a successful UWP build.

    Thanks again for the help @JohnTube
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @MRCalderon3D,

    Could you tell us why is the Master build failing?
    What errors do you see? could you share the output logs?
  • having the same problem right now. Can you guys update the package to be UWP compatible please?
  • also there is this file called libspeexdsp.dll into x86_64 that if you set the cpu to X64 it fails. Not sure to what that should be set.
  • creat326
    creat326 ✭✭
    edited January 2018
    And I also have the same problem with debug/release/master. It works except if you want to make a Master build (to release it to the store).
    You get a 'Activation of the Windows Store App X failed with error 'The app didn't start'

    Ironically it only happens when you use x86 build. If you build for x64 it works. So my guess is that you are either missing a dll or you have hardcoded a path like c:\whatever into your dll because that's the only other time I've seen that happening on visual studio.

  • ok, it's clear, i think all crashes and problems are with libspeexdsp.dll
    if i use it only for x64, it will compile, but then the store rejects the ARM build because there is no dll for arm
    if i use it for x86 then it crashes because it seems to be a 64 bits version
    so what do we do with that dll on x32 and arm builds?