Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'Unity Build Automation' started by nickfourtimes, Mar 16, 2017.

  1. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    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:

    Code (CSharp):
    1. 4072: [Unity] Plugin 'InControlNative.dll' is used from several locations:
    2. 4073: [Unity] Plugin 'CSteamworks.dll' is used from several locations:
    3. 4074: [Unity] Plugin 'openvr_api.dll' is used from several locations:
    4. 4075: [Unity] Please fix plugin settings and try again.
    5. 4076: [Unity] Player export failed. Reason: 2 errors
    6. 4077: ! build of 'default-ios' failed. compile failed
    7. 4078: publishing finished successfully.
    8. 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!
     
  2. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
  3. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    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!
     
  4. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    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!

    Code (CSharp):
    1.  
    2. using UnityEditor;
    3. using UnityEngine;
    4.  
    5.  
    6. public class UnityCloudBuild : MonoBehaviour {
    7.  
    8.     public static void CloudBuildIosPreBuild() {
    9.         Debug.Log("Begin Cloud Build pre-build steps");
    10.  
    11.         var allImporters = PluginImporter.GetAllImporters();
    12.         foreach (var importer in allImporters) {
    13.             if (importer.assetPath.Contains("CSteamworks") ||
    14.                 importer.assetPath.Contains("InControlNative") ||
    15.                 importer.assetPath.Contains("openvr_api")) {
    16.                 // Debug.Log("Changing import settings on " + importer.assetPath + ".");
    17.                 importer.SetCompatibleWithAnyPlatform(false);
    18.             }
    19.         }
    20.  
    21.         return;
    22.     }
    23. }
    24.  
     
  5. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    Thanks for sharing!

    - Sophia