Search Unity

Unity UWP build crashes when establishing connection to Cloud SQL Database.

Discussion in 'Windows' started by SeanS24, Aug 21, 2018.

  1. SeanS24

    SeanS24

    Joined:
    Aug 17, 2018
    Posts:
    7
    Hi all.

    I have a rather odd problem. I am using System.data.sqlclient.

    I get to the part which tries to make a connection to an SQL Databae on the cloud I get this nullref error in Visual studio Community 2017.

    Unity Version: 2018.1.9f1
    My scripting runtime version is: .NET 4.x Equivalent
    Scripting backend is: IL2CPP API Compatibility level is: .NET 4.x

    I am using System.data.dll from .../2.0api this resides in my asset folder. Unity Editor works, I've also built a UWP app in visual studio and it works fine But the UWP build from Unity gives me the errors below when I try to connect to my cloud sql database.

    Any input will be appreciated.

    The errors are:
    nullrefOutput.PNG nullrefCallstack.PNG
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    The assemblies from "xxx-api" folder are empty implementations, and each method does "throw null;". You want an assembly from 4.5 folder instead (if you're using .NET 4.x API compat level).
     
  3. SeanS24

    SeanS24

    Joined:
    Aug 17, 2018
    Posts:
    7
    Hey Tautvydas,

    Thanks for your reply. I have since done what you have said and it sorted the error above, the app isn't hanging or crashing however, I am not getting data from the SQL database on Azure Cloud, but thanks again.

    However, I have another issue: I am guessing the issue lies around TLS support in 2018.1 and some searching it was sorted in 2018.2? devConsole.PNG newerrorTLS.PNG
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yeah, TLS isn't functional until 2018.2 unless you use UnityWebRequest to make your web connections.