Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

☄️ UDP (IAP). Run StoreService.QueryInventory(this) in Editor. Error

Discussion in 'Unity IAP' started by makaka-org, Apr 18, 2020.

  1. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,039
    So since there is no separate section for UDP, I post here.

    I need to implement non-consumable IAP.

    I try to run StoreService.QueryInventory(this) in Editor after successful StoreService.Initialize(this);

    I use pure UDP package 1.3.0 from Package Manager & Unity 2019.3.9.

    And I get 2 different errors with different constructors of QueryInventory:

    1st:
    • Message: Exception: JNI: Init'd AndroidJavaObject with null ptr!
    • Stack Trace: UnityEngine.AndroidJavaObject..ctor (System.IntPtr jobject) (at /Users/builduser/buildslave/unity/build/Modules/AndroidJNI/AndroidJava.cs:371)
    2nd:
    • Message: NullReferenceException: Object reference not set to an instance of an object
    • Stack Trace: UnityEngine._AndroidJNIHelper.GetSignature (System.Object obj) (at /Users/builduser/buildslave/unity/build/Modules/AndroidJNI/AndroidJava.cs:1513)

    I have 2 questions:
    1. What’s wrong? Is there an opportunity to test in the Editor?
    2. How Can it get product price without this request (for stores that doesn’t support it) for showing it in UI?
     
  2. JayR

    JayR

    Joined:
    Aug 2, 2016
    Posts:
    84
    Hi @atorisa

    We'll ask the UDP team to take a look here and respond and/or point you in the right direction for assistance.
     
    makaka-org likes this.
  3. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    I'm getting the same error as the first one listed above. I'm using Unity 2019.4.2 and latest UDP package 2.0.0
     
  4. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,039
    any news?
     
  5. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    UDP is not supported in editor mode, please build an APK, run on the phone and test it again.

    UDP targeted APK only support for publishing to UDP Partner Stores. When you export the APK for Google Play, you should set the export target to Google Play.

    upload_2020-7-23_17-33-14.png