Search Unity

Error: "...'Ports' does not exist ..." for iOS platform

Discussion in 'Connected Games' started by blackgun, May 24, 2019.

  1. blackgun

    blackgun

    Joined:
    May 27, 2014
    Posts:
    4
    Hi

    My bluetooth project is working well when platform is PC/Mac, but the building is failed with iOS platform.

    The code is broken at
    Code (CSharp):
    1. using System.IO.Ports;
    Error:
    Code (CSharp):
    1. Assets/Script1.cs(4,17): error CS0234: The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)
    2.  
    My project setting for "iOS platform":
    • Scripting Runtime Version: .NET 4.x Equivalent
    • Scripting Backend : IL2CPP (it's greyed out as the only one option)
    • Api Compatibility Level : .NET Standard 2.0

    My Env:
    • macOS Mojave 10.14.5
    • Unity 2019.1.2f1
    • Visual Studio for Mac community, v8.0.8 (build 2)
    • Xcode 10.2.1

    I googled a lot and checked all related discussion, they don't solve or related to this issue.

    Thanks in prior.
     
  2. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,122
    Pretty sure you need to use the native stuff for those platforms. They don't let you access the deamons and such from the sandbox.
     
  3. blackgun

    blackgun

    Joined:
    May 27, 2014
    Posts:
    4
    Sorry for just noticing its in wrong category, should be "support" board.