Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by shay4545 · Nov 22, 2014 at 01:54 AM · androiderrorpluginsoomla

Soomla Error for android

I have created my own store front with the soomla tutorials. I'm getting an error when I start my game. The script with my store stuff is:

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 namespace Soomla.Store.Example {
     /// <summary>
     /// This class defines our game's economy, which includes virtual goods, virtual currencies
     /// and currency packs, virtual categories
     /// </summary>
     public class IAPitems : IStoreAssets{
         /// <summary>
         /// see parent.
         /// </summary>
         public int GetVersion() {
             return 0;
         }
         /// <summary>
         /// see parent.
         /// </summary>
         public VirtualCurrency[] GetCurrencies() {
             return new VirtualCurrency[]{CREDITS_CURRENCY};
         }
         /// <summary>
         /// see parent.
         /// </summary>
         public VirtualGood[] GetGoods() {
             return new VirtualGood[] {RAINBOW_CHICKEN, HALLOWEEN_CHICKEN, SANTA_CHICKEN, NO_ADS_LTVG};
         }
         /// <summary>
         /// see parent.
         /// </summary>
         public VirtualCurrencyPack[] GetCurrencyPacks() {
             return new VirtualCurrencyPack[] {SMALL_CREDITS_PACK, MEDIUM_CREDITS_PACK, BIG_CREDITS_PACK, MEGA_CREDITS_PACK};
         }
         /// <summary>
         /// see parent.
         /// </summary>
         public VirtualCategory[] GetCategories() {
             return new VirtualCategory[]{GENERAL_CATEGORY};
         }
         /** Static Final Members **/
         public const string CREDITS_CURRENCY_ITEM_ID = "currency_credits";
         public const string SMALL_CREDITS_PACK_PRODUCT_ID = "android.test.refunded";
         public const string MEDIUM_CREDITS_PACK_PRODUCT_ID = "android.test.canceled";
         public const string BIG_CREDITS_PACK_PRODUCT_ID = "android.test.purchased";
         public const string MEGA_CREDITS_PACK_PRODUCT_ID = "2500_pack";
         public const string RAINBOW_CHICKEN_ITEM_ID = "rainbow_chicken";
         public const string HALLOWEEN_CHICKEN_ITEM_ID = "halloween_chicken";
         public const string SANTA_CHICKEN_ITEM_ID = "santa_chicken";
         public const string NO_ADS_LIFETIME_PRODUCT_ID = "no_ads";
         /** Virtual Currencies **/
         public static VirtualCurrency CREDITS_CURRENCY = new VirtualCurrency(
             "Credits", // name
             "", // description
             CREDITS_CURRENCY_ITEM_ID // item id
             );
 
         /** Virtual Currency Packs **/
         public static VirtualCurrencyPack SMALL_CREDITS_PACK = new VirtualCurrencyPack(
             "5000 Credits", // name
             "Test refund of an item", // description
             "5kCredits", // item id
             5000, // number of currencies in the pack
             CREDITS_CURRENCY_ITEM_ID, // the currency associated with this pack
             new PurchaseWithMarket(SMALL_CREDITS_PACK_PRODUCT_ID, 0.99)
             );
         public static VirtualCurrencyPack MEDIUM_CREDITS_PACK = new VirtualCurrencyPack(
             "27500 Credits", // name
             "Test cancellation of an item", // description
             "27kCredits", // item id
             27500, // number of currencies in the pack
             CREDITS_CURRENCY_ITEM_ID, // the currency associated with this pack
             new PurchaseWithMarket(MEDIUM_CREDITS_PACK_PRODUCT_ID, 4.99)
             );
         public static VirtualCurrencyPack BIG_CREDITS_PACK = new VirtualCurrencyPack(
             "55000 Credits", // name
             "Test purchase of an item", // description
             "55kCredits", // item id
             55000, // number of currencies in the pack
             CREDITS_CURRENCY_ITEM_ID, // the currency associated with this pack
             new PurchaseWithMarket(BIG_CREDITS_PACK_PRODUCT_ID, 9.99)
             );
         public static VirtualCurrencyPack MEGA_CREDITS_PACK = new VirtualCurrencyPack(
             "120000 Credits", // name
             "Test item unavailable", // description
             "120kCredits", // item id
             120000, // number of currencies in the pack
             CREDITS_CURRENCY_ITEM_ID, // the currency associated with this pack
             new PurchaseWithMarket(MEGA_CREDITS_PACK_PRODUCT_ID, 19.99)
             );
 
         /** LifeTimeVGs **/
         // Note: create non-consumable items using LifeTimeVG with PuchaseType of PurchaseWithMarket
         public static VirtualGood RAINBOW_CHICKEN = new LifetimeVG(
             "Rainbow Chicken", // name
             "Unlock the Rainbow Chicken", // description
             "rainbow_chick", // item id
             new PurchaseWithVirtualItem(CREDITS_CURRENCY_ITEM_ID, 15000)); // the way this virtual good is purchased
         public static VirtualGood HALLOWEEN_CHICKEN = new LifetimeVG(
             "Halloween Chicken", // name
             "Unlock the Halloween Chicken", // description
             "halloween_chick", // item id
             new PurchaseWithVirtualItem(CREDITS_CURRENCY_ITEM_ID, 30000)); // the way this virtual good is purchased
         public static VirtualGood SANTA_CHICKEN = new LifetimeVG(
             "Santa Chicken", // name
             "Unlock the Santa Chicken", // description
             "santa_chicken", // item id
             new PurchaseWithVirtualItem(CREDITS_CURRENCY_ITEM_ID, 50000)); // the way this virtual good is purchased
         public static VirtualGood NO_ADS_LTVG = new LifetimeVG(
             "No Ads", // name
             "No More Ads!", // description
             "no_ads", // item id
             new PurchaseWithMarket(NO_ADS_LIFETIME_PRODUCT_ID, 0.99)); // the way this virtual good is purchased
 
         /** Virtual Categories **/
         // The muffin rush theme doesn't support categories, so we just put everything under a general category.
         public static VirtualCategory GENERAL_CATEGORY = new VirtualCategory(
             "General", new List<string>(new string[] { RAINBOW_CHICKEN_ITEM_ID, HALLOWEEN_CHICKEN_ITEM_ID, SANTA_CHICKEN_ITEM_ID })
             );
     }
 }

The error im getting is: NullReferenceException: Object reference not set to an instance of an object Soomla.Store.SoomlaStore.Initialize (IStoreAssets storeAssets) (at Assets/Plugins/Soomla/Store/SoomlaStore.cs:88) HomeScreen.Start () (at Assets/Scripts/HomeScreen.cs:12)

The line on the HomeScreen script for the error is:

 SoomlaStore.Initialize(new Soomla.Store.Example.IAPitems());


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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by liortal · Nov 22, 2014 at 09:54 PM

I do not know the Soomla framework or plugin, but by looking at their code, it looks like the reference comes from this code inside the Initialize method (SoomlaStore.cs:88):

 StoreEvents.Instance.onSoomlaStoreInitialized("", true);

The StoreEvents component is probably added to some game object or prefab that should have been created before accessing it.

Make sure you have this object in your scene.

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.

Follow this Question

Answers Answers and Comments

27 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

Related Questions

Android Build problem? 2 Answers

Android plugins and callbacks on non-scripting threads 1 Answer

Accessing the Activity Context in Android plugin 1 Answer

Help with error message when uploading to Android Market? 0 Answers

facebook and soomla sdk error 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