appId missing when built with Unity Cloud Build

Hi,

I just updated to PUN2 (2.16) and Unity 2019.3.1 and I am having an issue with iOS builds created with Unity Cloud Build. The completes without any errors but when I load it on a device and run it I get
"default 14:11:18.069128+1100 catapults The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
Photon.Pun.PhotonHandler:Dispatch()"


This is followed by
default 14:11:18.069799+1100 catapults PUN got region list. Going to ping minimum regions, based on this previous result summary: asia;158;asia,au,cae,eu,in,jp,kr,ru,rue,sa,us,usw,za
Photon.Pun.PhotonNetwork:OnOperation(OperationResponse)
System.Action`1:Invoke(T)
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
Photon.Pun.PhotonHandler:Dispatch()

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

and then a crash.
default 14:11:18.101171+1100 catapults NullReferenceException: Object reference not set to an instance of an object.
at Photon.Pun.PhotonNetwork.OnOperation (ExitGames.Client.Photon.OperationResponse opResponse) [0x00000] in <00000000000000000000000000000000>:0
at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at Photon.Realtime.LoadBalancingClient.OnOperationResponse (ExitGames.Client.Photon.OperationResponse operationResponse) [0x00000] in <00000000000000000000000000000000>:0
at ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (ExitGames.Client.Photon.StreamBuffer stream) [0x00000] in <00000000000000000000000000000000>:0
at ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands () [0x00000] in <00000000000000000000000000000000>:0
at ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands () [0x00000] in <00000000000000000000000000000000>:0
at Photon.Pun.PhotonHandler.Dispatch () [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not avai<…>


If I do a local build and use xcode to push it to a device I don't get these errors. Are you able to point me in the right direction?

Thanks

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @BigGameCo,

    Did you try the "Clean Build" solution here?
  • Thanks for the reply. That post actually says NOT to use the clean build option. I have tried both and both have problems. I'll see if the error message with the clean build is the same. From memory it didn't crash but also didn't connect to Photon properly.
  • BigGameCo
    BigGameCo
    edited February 2020
    Just checked and the clean build does crash with the same error
  • Hi,

    I am currently investigating the issue, and I can't find any actual issues with pun code itself, all I find is lots of bugs and malfunctionning inside the Unity cloud system itself ( licensing issue, then cloud log errors that Unity is already opened, etc.)

    I would suggest that you verify that a clean project works with just pun and the demos, and then compare what could be different with your project. If that clean project doesn't work, you can add me to that Unity project as a collaborator so that I can check what's in it that bugs.

    Are you using Unity collaborate on that project?

    Bye,

    Jean

  • Thanks Jean. No I am not using collaborate, I'm using Git. Have you been able to get the PUN demos working with Unity Cloud Build? I'll give it a shot.
  • I've implemented the playfab / photon integration. I no longer get crashes but the cloud builds still don't work (local builds work fine). This is the error message:
    PlayFab + Photon Example: /Client/GetPhotonAuthenticationToken: Invalid input parameters
    PhotonApplicationId: The PhotonApplicationId field is required.
    

    It seems like the PhotonServerSettings are not getting loaded or included properly when making a cloud build. I've tried setting the app id in the code but I still get the same error.
    PhotonNetwork.PhotonServerSettings.AppSettings.AppIdRealtime = "xxx";
            PlayFabClientAPI.GetPhotonAuthenticationToken(new GetPhotonAuthenticationTokenRequest()
            {
                
                PhotonApplicationId = PhotonNetwork.PhotonServerSettings.AppSettings.AppIdRealtime
            }, AuthenticateWithPhoton, OnPlayFabError);
    

    Any thoughts?

    Thanks again
  • Hi,

    We identified where things go wrong, but without exactly understand what's going yet, the fix will be in the next pun update, meanwhile, can you do the following and try?

    in PhotonEditor.cs locate the method OnProjectChanged()

    and insert right at the begining this:

    #if UNITY_CLOUD_BUILD
    return;
    #endif

    so that nothing is executed on that method if we are in the Unity Cloud build context.

    Let me know how it goes.

    Bye,

    Jean
  • yes that appears to have fixed it.

    Thanks very much.
  • Hi,

    Great, thanks for letting us know :)

    Bye,

    Jean
  • speakerguru
    edited June 2020
    Hello!

    Have the same issue with PUN+ Classic (v1.92 (26. October 2018)), how to solve it?
    Does v1.103.1 (30. April 2020) solve the issue?

    Kind regards,
    Aleksandr
  • Hi,

    yes, it does, the latest version of PUN should have this fix.

    Bye,

    Jean