• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by pitylee · Feb 24, 2018 at 11:33 PM · nullreferenceexception

NullReferenceException Test UI

Hi there!

I have NullReferenceException in PlatformBase.cs saying:

 NullReferenceException: Object reference not set to an instance of an object
 GameSparks.Api.QueuePersistor.Read (GameSparks.Core.GSInstance gsInstance)
 GameSparks.Core.GSInstance.InitialisePersistentQueue ()
 GameSparks.Core.GSInstance.Initialise (IGSPlatform platform)
 GameSparks.Core.GS.Initialise (IGSPlatform gSPlatform)
 GameSparks.Platforms.PlatformBase.Start () (at Assets/GameSparks/Platforms/PlatformBase.cs:248)

All I've done is include the Gamesparks asset and opened the testui. The same project synced in collab is working for my team mates.

Any ideas?

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
-1
Best Answer

Answer by Xarbrough · Feb 25, 2018 at 12:24 AM

You would need to see the code on line 248 of the PlatformBase.cs script to tell, but it looks like some reference wasn't set up in the inspector or some resource is not available (maybe another manager script in the scene? It's communicating with singletons, maybe they need to be added to the scene, or maybe they are initialized in the wrong order and you have to set up custom script execution order for your project). If you don't have source code access and there's nothing obvious to find, you should contact the package's author. ;)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by LucyM · Apr 20, 2018 at 11:00 AM

@pitylee I had this same issue and managed to solve it by setting the private String m_userId to 1234 (any number should work) so,

 private String m_userId="1234";

and then in your player settings enter GS_DONT_USE_PLAYER_PREFS in the Scripting Define Symbols in the Other Settings tab, dont forget to save with ctrl + s to save the field and thats it.

For me this solved the issue was quite bizzare one actually.

Hope this helps!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by donhmx · Aug 13, 2018 at 06:01 PM

Just ran in to this - GameSparks is saving some data via PlayerPrefs which gets saved to the registry.

[HKCU] -> Unity -> Unity Editor -> YOUR COMPANY -> YOUR APP

Delete the keys starting with 'gamesparks' - this fixed it for me.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MrLucid72 · Mar 18, 2020 at 01:00 PM 0
Share

You are a god, sir

avatar image
0

Answer by meizh · Mar 16, 2018 at 05:09 AM

I had same issue, and the workaround that just set the userid to any non-empty string should solve the issue. You can do this by setting a breakpoint (at Assets/GameSparks/Platforms/PlatformBase.cs:248), and change the userid value in your IDE

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Pajgla · Mar 20, 2019 at 11:31 PM

I still have this problem and nothing actually helps from the above. Anyone else found solution ?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

81 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Anyone Else wanna take a wack at the question ? Need help fixing a script error... 5 Answers

Object reference not set to an instance of an object? 1 Answer

NullReference Problem with pragma strict 1 Answer

How can i fix this weird error 2 Answers

Need a hand using array.Length in a C# editor script 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges