title: Unity & P4Connect
body: <p>I just set up a Perforce server for my company where I'm going to store some depots for our Unity projects. I'm using the P4Connect plugin to integrate p4 functionalities in Unity.</p>
  
  <p>However I'm experiencing some problems in the submission phase of my files, the exact error shown on a popup is: </p>
  
  <pre><code>"Cannot submit files... Submit failed4, open P4V and make sure your files are in the default change list"
  </code></pre>
  
  <p>The files are actually already in the default change list, unfortunately P4Connect log files don't show anything regarding this error.</p>
  
  <p>These are the steps I made from the creation of the depot to the submission attempt.</p>
  
  <ol>
  <li>I create a local depot on the server using P4Admin</li>
  <li>I make sure I have enough privileges to access/edit the depot</li>
  <li>Using P4V I create a new workspace with its root matching the one of the depot</li>
  <li>Through window explorer I copy my project inside the root of the workspace</li>
  <li>I open with Unity the project in the workspace</li>
  <li>In project settings I enable visible metafiles</li>
  <li>I install P4Connect from the unity asset store</li>
  <li>I configure it and make sure it can connect to the server and that the workspace name matches the one I created using P4V</li>
  <li>Until now everything works, the plugin recognizes the new files </li>
  <li>Since every file is new I select every file and click on "add to depot"</li>
  <li>In the Perforce tab I enter a description and click on submit</li>
  <li>The error previously described shows up</li>
  </ol>
  
  <p>The problem arises even if I try to add a single file instead of the whole project.</p>
  
  <p>here is the callstack of an exception that is thrown:</p>
  
  <pre><code>NullReferenceException: Object reference not set to an instance of an object
  Perforce.P4.FileMetaData.op_Implicit (Perforce.P4.FileMetaData s) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Bridge/p4api.net/FileMetaData.cs:866)
  Perforce.P4.Changelist.ToString () (at c:/tmp/53044412/depot/main/p4-connect/src/P4Bridge/p4api.net/Changelist.cs:584)
  Perforce.P4.Repository.SaveChangelist (Perforce.P4.Changelist change, Perforce.P4.Options options) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Bridge/p4api.net/Repository.Changelist.cs:54)
  Perforce.P4.Repository.CreateChangelist (Perforce.P4.Changelist change, Perforce.P4.Options options) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Bridge/p4api.net/Repository.Changelist.cs:331)
  Perforce.P4.Repository.CreateChangelist (Perforce.P4.Changelist change) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Bridge/p4api.net/Repository.Changelist.cs:435)
  P4Connect.Engine.SubmitFiles (P4Connect.PerforceConnection aConnection, System.String aChangeListDescription, System.Collections.Generic.List`1 aFiles) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:818)
  UnityEngine.Debug:LogException(Exception)
  P4Connect.Engine:SubmitFiles(PerforceConnection, String, List`1) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:825)
  P4Connect.&lt;&gt;c__DisplayClassa:&lt;SubmitFiles&gt;b__8(PerforceConnection) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:917)
  P4Connect.Engine:PerformConnectionOperation(Action`1) (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:753)
  P4Connect.PendingChanges:SubmitFiles() (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:917)
  P4Connect.PendingChanges:OnGUI() (at c:/tmp/53044412/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:744)
  UnityEditor.DockArea:OnGUI()
  </code></pre>
  
  <p>If I use P4V to submit those files everything works fine, however I prefer to avoid using P4V since it's not integrated with Unity and makes the whole thing more complex to manage.</p>
  
  <p>Am I doing something wrong or does anyone had similar problems and knows how to fix this?
  I'm using Unity 5.1.1f1 and P4Connect 2.7 (actually the latest versions for both).</p>
  
  <p>Thanks</p>