Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug 0.4.00-preview.1 build error on Android when using Perforce (and now iOS on reverting)

Discussion in 'Unity Mediation' started by masterton, Feb 14, 2022.

  1. masterton

    masterton

    Joined:
    Dec 11, 2012
    Posts:
    31
    With the 0.4.0 preview of mediation I cannot build on Android. We are using Perforce for source control and I suspect this is the problem. When building Unity tries to checkout the MediationAdapterDependencies.xml and fails. See below and attached:

    UnauthorizedAccessException: Access to the path "E:\p4\Game\proto_1\Assets\Editor\MediationAdapterDependencies.xml" is denied.
    at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <695d1cc93cca45069c528c15c9fdd749>:0


    Even though this was a local build, I've seen this issue a lot when combing Cloud Build, Perforce and other .xml files. It's part of the reason we moved away from those "other mediation" companies.

    For now I've reverted to 0.3.0 which does not have this build error.

    Is there a way, through scripting, to switch source control to Offline mode before building? I think this would solve some of the other build issues we've been having with Perforce.
     

    Attached Files:

  2. masterton

    masterton

    Joined:
    Dec 11, 2012
    Posts:
    31
    However now that we have reverted back to 0.3.0 iOS fails on cloud build! Currently completely borked for builds, can someone look at this please?

    271: ❌; /BUILD_PATH/game/temp20220215-5106-1kppmhc/Libraries/com.unity.services.mediation/Runtime/Plugins/iOS/UMSPImpressionDelegate.mm:30:107: no visible @interface for 'NSDecimalNumber' declares the selector 'UTF8String'
    272: ❌; /BUILD_PATH/game/temp20220215-5106-1kppmhc/Libraries/com.unity.services.mediation/Runtime/Plugins/iOS/UMSPImpressionDelegate.mm:31:70: bad receiver type 'int64_t' (aka 'long long')
     
  3. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    143
    Hello @masterton,

    Regarding the iOS issue:
    Try uninstalling an adapter, and reinstall it after. What is most likely happening is that your project still has the dependencies you require for 0.4.0 in your xml dependency file. Reinstalling an adapter will reset that file to the dependencies required for the currently installed version.

    Let us know if that fixes the issue for you.
     
  4. DeclanMcPartlin

    DeclanMcPartlin

    Unity Technologies

    Joined:
    Nov 19, 2020
    Posts:
    143
    Regarding your Android issue, this is most likely tied to Perforce itself than Unity Mediation. Perforce has a tendency to set files as read-only, so you might want to look into having at least that file (Assets\Editor\MediationAdapterDependencies.xml) set as writeable, since without that xml file, Unity Mediation cannot determine which dependencies are required. This type of change only occurs at package version changes or adapter support changes, since the underlying dependencies might have changed.

    I cannot speak for Perforce or what the optimal solution here is for you, but one option is to setup Perforce in a way that it leaves files as writeable, as explained here.

    "Is there a way, through scripting, to switch source control to Offline mode before building?" - could you explain further what you have in mind with "switch source control to Offline mode" ?

    Let us know if that helps, thank you for reaching out.
     
  5. masterton

    masterton

    Joined:
    Dec 11, 2012
    Posts:
    31
    I did the uninstall/reinstall process and it produced the same XML file, which in a way is good because I could eliminate that as the problem.

    Fixed: The problem was the code version! We had it at xcode 13, so I switched it to 13.2.1 and voila! It compiles again with no issues!
     
    jcGrenier likes this.
  6. masterton

    masterton

    Joined:
    Dec 11, 2012
    Posts:
    31
    I will "check out" (ha! perforce pun!) the writeable setting for the perforce clientspec. Thanks!!