[SOLVED] Cloud Build -- plugin is used from several locations

Hey,
I’m building an iOS project using Cloud Build, but I’m coming up against some plugin collisions at the very end of the log:

4072: [Unity] Plugin 'InControlNative.dll' is used from several locations:
4073: [Unity] Plugin 'CSteamworks.dll' is used from several locations:
4074: [Unity] Plugin 'openvr_api.dll' is used from several locations:
4075: [Unity] Please fix plugin settings and try again.
4076: [Unity] Player export failed. Reason: 2 errors
4077: ! build of 'default-ios' failed. compile failed
4078: publishing finished successfully.
4079: Finished: FAILURE

If this was a local build I’d be fine to just uncheck “Any Platform” in the plugin settings/inspector, but for a cloud build I’m not sure what to do… I can make the changes locally but I don’t know how to push them to the server.

Any tips greatly appreciated!

Hello,

Perhaps you would find platform dependent compilation useful?

Let me know how you get on.

Kind regards,

Ah, interesting. And then I suppose I can use something like PluginImporter to find the offending plugins, and set the appropriate platform data in a pre-export method? That sounds do-able. Thanks!

For future reference… I created the following file (UnityCloudBuild.cs) in my Editor/ folder, and then called UnityCloudBuild.CloudBuildIosPreBuild from the pre-export options, as mentioned above. Seems to have worked!

using UnityEditor;
using UnityEngine;


public class UnityCloudBuild : MonoBehaviour {

    public static void CloudBuildIosPreBuild() {
        Debug.Log("Begin Cloud Build pre-build steps");

        var allImporters = PluginImporter.GetAllImporters();
        foreach (var importer in allImporters) {
            if (importer.assetPath.Contains("CSteamworks") ||
                importer.assetPath.Contains("InControlNative") ||
                importer.assetPath.Contains("openvr_api")) {
                // Debug.Log("Changing import settings on " + importer.assetPath + ".");
                importer.SetCompatibleWithAnyPlatform(false);
            }
        }

        return;
    }
}

Thanks for sharing!

  • Sophia