Jump to content


Error when starting game in Unity 5.4.2


  • Please log in to reply
9 replies to this topic

#1 ava

ava

    Member

  • Members
  • PipPip
  • 23 posts
  • LocationBruges

Posted 15 October 2016 - 11:36 AM

Hello,

I updated to Unity 5.4.2f1 and P4Connect 2016.2.144.1849-Release. When I start any scene I get this in the error log:

get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'Config'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Application:get_dataPath()
P4Connect.Main:SetupRootDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:123)
P4Connect.Main:Initialize() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:84)
P4Connect.Main:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:75)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:GetEditorAssetRelativeDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:921)
P4Connect.Config:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Config.cs:898)

Not sure why perforce does anything at runtime of the game?

Thanks,
Alex

#2 ava

ava

    Member

  • Members
  • PipPip
  • 23 posts
  • LocationBruges

Posted 18 October 2016 - 12:41 PM

I also get this:

P4Exception: trying to run a command on a disposed server
Perforce.P4.P4Server.RunCommand (System.String cmd, UInt32 cmdId, Boolean tagged, System.String[] args, Int32 argc) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Bridge/p4api.net/P4Server.cs:1235)
Perforce.P4.P4Command.RunInt (Perforce.P4.StringList flags) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Bridge/p4api.net/P4Command.cs:411)
UnityEngine.Debug:LogException(Exception)
P4Connect.Engine:LogP4Exception(Exception) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:2000)
P4Connect.Engine:PerformOperation(String[], String[], AssetOperation) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:1010)
P4Connect.Engine:CheckoutAssets(String[]) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:585)
P4Connect.Engine:CheckoutAsset(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:534)
P4Connect.AssetBridge:OpenFile(Int32, Int32) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.AssetBridge.cs:174)
UnityEditorInternal.LogEntries:ClickStatusBar(Int32)
UnityEditor.AppStatusBar:OnGUI()

Also related to the data path issue i presume?

#3 Vintage_Green

Vintage_Green

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 30 October 2016 - 08:44 PM

I'm also unable to use Perforce since updating unity from 5.4.1 to 5.4.2. I think perforce needs to recompile the code with the updated unity in mind.

NullReferenceException: Object reference not set to an instance of an object
P4Connect.Extensions.ToAssetPath (Perforce.P4.FileMetaData fmd) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1490)
P4Connect.Extensions+<ToAssetPaths>d__94.MoveNext () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1497)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection, IEqualityComparer`1 comparer)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection)
P4Connect.Extensions.ToHashSet (IEnumerable`1 files) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1265)
P4Connect.ChangeManager.GetHashMap (Int32 id) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:137)
P4Connect.PendingChanges.UpdateList () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:375)
P4Connect.PendingChanges.OnEnable () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:215)
UnityEditor.EditorWindow:GetWindow(Type, Boolean, String)
P4Connect.PendingChanges:ShowWindow() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.PendingChanges.cs:131)


http://imgur.com/2DcL3gu

#4 Vintage_Green

Vintage_Green

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 31 October 2016 - 11:07 AM

Just post my post please

#5 Vintage_Green

Vintage_Green

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 31 October 2016 - 11:08 AM

NullReferenceException: Object reference not set to an instance of an object
P4Connect.Extensions.ToAssetPath (Perforce.P4.FileMetaData fmd) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1490)
P4Connect.Extensions+<ToAssetPaths>d__94.MoveNext () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1497)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection, IEqualityComparer`1 comparer)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection)
P4Connect.Extensions.ToHashSet (IEnumerable`1 files) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1265)
P4Connect.ChangeManager.GetHashMap (Int32 id) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:137)
P4Connect.ChangeManager.OnUpdatedFiles (IEnumerable`1 assetPaths) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:37)
P4Connect.AssetStatusCache.OnUpdate () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.AssetStatusCache.cs:297)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:222)

#6 Vintage_Green

Vintage_Green

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 31 October 2016 - 11:15 AM

NullReferenceException: Object reference not set to an instance of an object
P4Connect.Extensions.ToAssetPath (Perforce.P4.FileMetaData fmd) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1490)
P4Connect.Extensions+<ToAssetPaths>d__94.MoveNext () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1497)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection, IEqualityComparer`1 comparer)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection)
P4Connect.Extensions.ToHashSet (IEnumerable`1 files) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1265)
P4Connect.ChangeManager.GetHashMap (Int32 id) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:137)
P4Connect.ChangeManager.OnUpdatedFiles (IEnumerable`1 assetPaths) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:37)
P4Connect.AssetStatusCache.OnUpdate () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.AssetStatusCache.cs:297)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:222)

#7 mbraley

mbraley

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 17 November 2016 - 08:06 PM

Ditto, I get the same error! I also currently have a vanilla setup,  using P4Connect: 2016.2.144.1849-Release unityVersion: 5.4.2f2, nothing fancy, just trying to confirm that P4Connect works as expected. Unfortunately it does not.

NullReferenceException: Object reference not set to an instance of an object
P4Connect.Extensions.ToAssetPath (Perforce.P4.FileMetaData fmd) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1490)
P4Connect.Extensions+<ToAssetPaths>d__94.MoveNext () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1497)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection, IEqualityComparer`1 comparer)
System.Collections.Generic.HashSet`1[System.String]..ctor (IEnumerable`1 collection)
P4Connect.Extensions.ToHashSet (IEnumerable`1 files) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:1265)
P4Connect.ChangeManager.GetHashMap (Int32 id) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:137)
P4Connect.ChangeManager.OnUpdatedFiles (IEnumerable`1 assetPaths) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.ChangeManager.cs:37)
P4Connect.AssetStatusCache.OnUpdate () (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.AssetStatusCache.cs:297)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:222)

Which is very disappointing! The studio I'm currently at has recently switched technology to Unity. Some of the team have used Unity before, I haven't. No one else on the team has used Perforce, except me and at several different studio's over the last 10 years. Of the many studios I've worked at over the last 10 years, they all used Perforce. So I'm familiar with and know how excellently Perforce can perform in a game development environment.

I'm trying to convince the rest of the team that Perforce is the way to go. There are already several barriers, cost being one, another the steep learning costs if you've never used Perforce before. I believe you get what you pay for. But there is no way I can convince the rest of the team to use Perforce with Unity when it has this kind of crappy performance. If the rest of the team was willing to work through P4V, I might be able to sell it, but I know the expectation is to be able to use any version control system we adopt from within the Unity environment.

Which is a real shock knowing how large the Unity development community is. Shame on you Perforce, I know you can do better, but you've really dropped the ball on this one.

#8 stephejn

stephejn

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 25 November 2016 - 08:58 PM

It looks like I am having pretty much the same issue.  I installed p4connect mostly so I could make some perforce tools in the Unity Editor, but wanted to see if it had improved since I had stopped using it a while back.

On all assembly reloads, I get the following error:

Quote

get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'Config'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Application:get_dataPath()
P4Connect.Main:SetupRootDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:123)
P4Connect.Main:Initialize() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:84)
P4Connect.Main:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:75)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:GetEditorAssetRelativeDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:921)
P4Connect.Config:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Config.cs:898)

And all p4 operations fail with warnings afterward:

Quote

P4Connect - Assets/MS/SG/Test.asset isn't in the depot and cannot be checked out, the file will be marked for add instead
UnityEngine.Debug:LogWarning(Object)
P4Connect.Utils:LogFileWarning(String, String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:546)
P4Connect.Engine:GetFileOperation(String, AssetOperation, FileMetaData) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:1593)
P4Connect.Collector:GetFilesAndOps(PerforceConnection) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:1408)
P4Connect.Engine:AddToFilesAndOpList(PerforceConnection, String[], String[], AssetOperation) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:1244)
P4Connect.Engine:PerformOperation(String[], String[], AssetOperation) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:977)
P4Connect.Engine:CheckoutAssets(String[]) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Engine.cs:585)
P4Connect.AssetBridge:OnWillSaveAssets(String[]) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.AssetBridge.cs:78)
UnityEditor.AssetModificationProcessorInternal:OnWillSaveAssets(String[], String[]&, String[]&, Int32)

I am running Unity 5.4.2f2 and P4Connect 2016.2.144.1849

#9 mannixlo

mannixlo

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 16 December 2016 - 10:27 AM

I've also got the following error when I delete the file with the Perforce windows opened:

get_dataPath is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'Config'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Application:get_dataPath()
P4Connect.Main:SetupRootDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:123)
P4Connect.Main:Initialize() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:84)
P4Connect.Main:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Main.cs:75)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:FullPathToAssetPath(String) (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:764)
P4Connect.Utils:GetEditorAssetRelativeDirectory() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Utils.cs:921)
P4Connect.Config:.cctor() (at c:/tmp/69516846/depot/main/p4-connect/src/P4Connect/P4Connect/P4Connect.Config.cs:898)

#10 P4Norman

P4Norman

    Advanced Member

  • Staff
  • 81 posts
  • LocationOakland CA, USA

Posted 19 January 2017 - 08:06 PM

Please try the latest release 2017.1   The initialization code has been fixed.

You can ftp the latest release here:  ftp://ftp.perforce.com/perforce/r17.1/bin.multiarch/p4Connect.unitypackage




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users