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:
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.
[7896391--1005679--mediation-4-cannot-build.txt|attachment](upload://r7mAvgQxXyw14RLaHZuqQTQODyQ.txt) (28.3 KB)
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â)
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.
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.