• 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
Question by banyiknandor1 · Mar 12, 2021 at 12:07 PM · androidnullreferenceexceptioniap

Unity IAP Button: NullReferenceException: Object reference not set to an instance of an object

So I was using the IAP button as the tutorial showed me and the button won't work ingame only giving me this error:

NullReferenceException: Object reference not set to an instance of an object UnityEngine.Purchasing.UIFakeStore.InstantiateDialog () (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:175) UnityEngine.Purchasing.UIFakeStore.StartUI (System.String queryText, System.String okayButtonText, System.String cancelButtonText, System.Collections.Generic.List`1[T] options, System.Action`2[T1,T2] callback) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:153) UnityEngine.Purchasing.UIFakeStore.StartUI[T] (System.Object model, UnityEngine.Purchasing.FakeStore+DialogType dialogType, System.Action`2[T1,T2] callback) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/UIFakeStore.cs:128) UnityEngine.Purchasing.FakeStore.FakePurchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/FakeStore.cs:163) UnityEngine.Purchasing.FakeStore.Purchase (System.String productJSON, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/FakeStore/FakeStore.cs:132) UnityEngine.Purchasing.JSONStore.Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Stores/BaseStore/JSONStore.cs:354) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:60) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String purchasableId, System.String developerPayload) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:69) UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (System.String productId) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Purchasing/PurchasingManager.cs:43) UnityEngine.Purchasing.CodelessIAPStoreListener.InitiatePurchase (System.String productID) (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Codeless/CodelessIAPStoreListener.cs:145) UnityEngine.Purchasing.IAPButton.PurchaseProduct () (at Library/PackageCache/com.unity.purchasing@3.0.1/Runtime/Codeless/IAPButton.cs:108) UnityEngine.Events.InvokableCall.Invoke () (at :0) UnityEngine.Events.UnityEvent.Invoke () (at :0) UnityEngine.UI.Button.Press () (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68) UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110) UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261) UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Games/2020.1.5f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)

I know the generic problem with NullReferenceException but I just don't understand this.

Comment
vovkas
WMorais
trombonaut

People who like this

3 Show 0
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

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by ISLAMMOHY · Mar 14, 2021 at 04:07 AM

Same here, did you find any solution?

Comment

People who like this

0 Show 2 · 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 banyiknandor1 · Mar 14, 2021 at 08:25 AM 2
Share

Yes. You need to download the sample file too because it has the prefab for it. For some reason the main file 3.0 or something like that doesn't contain the UIFakeStoreCanvas prefab. In the package manager find In App Purchases then check for versions. Update it for the latest if you didn't already then download the sample.

avatar image ISLAMMOHY banyiknandor1 · Mar 14, 2021 at 08:30 AM 0
Share

Thanks, yes it resolves the problem

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

262 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 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 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 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

Script works on some objects and not others, also varies between scenes... 0 Answers

How do I Build & Run Android game as a specific Google Account? 2 Answers

Google Play console Current Subscription "Add Offer" not showing 0 Answers

Google IAP: How to tell if a product is purchased? 0 Answers

Unavailable product in Unity iap subscriptions 0 Answers


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