Search Unity

Unity Distribution Portal Error

Discussion in 'Unity IAP' started by mkudimov, Apr 9, 2019.

  1. mkudimov

    mkudimov

    Joined:
    Jan 7, 2018
    Posts:
    10
    Hello.

    I have some simmilar errors.

    Managed Stack Trace:

    UnityEngine.Purchasing.UDPBindings.OnInitializeFailed (System.String message) (at <00000000000000000000000000000000>:0)
    UnityEngine.UDP.MainThreadDispatcher.Update () (at <00000000000000000000000000000000>:0)

    What did I do:
    * did not wait for a full launch in Catappult, although everything was running in Moo;
    * went to Dev Console Catappult and started the application manually
    * only 1 of 3 IAP was added, manually added the remaining 2
    * currently also manually stopped the application in Catappult
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,908
    Where are you seeing this error? Is this for your Catappult app? What do you mean "did not wait for full launch". Also, you want to add your IAP products before submitting your app.
     
  3. lizhgong

    lizhgong

    Unity Technologies

    Joined:
    Nov 14, 2016
    Posts:
    2
  4. ldhongen1990

    ldhongen1990

    Joined:
    Dec 18, 2015
    Posts:
    61
    I have the same problem.

    The Moo Store repacked APK has no problem (This means that the UDP integration is working well) but the Catapult repacked APK is throwing up that UnityEngine.Purchasing.UDPBindings.OnInitializeFailed with a null reference exception.

    My catapult repacked APK is using the 0.2.9 sdk according to the UDP portal advanced settings.
    I have already installed AppCoins BDS Wallet on the test device (but not logged in)

    I am using Unity 2018.3.12f1.
    I am using the Unity IAP -> UDP integration (Meaning I have to select Target UDP in my UnityIAP).
    My Unity IAP is version 1.22.0

    Is there any extra settings I need to perform on say an external catapult website dashboard or something? Everything should be streamlined and one-click from Unity's UDP dashboard right?
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,908
    Can you try after logging in?
     
  6. ldhongen1990

    ldhongen1990

    Joined:
    Dec 18, 2015
    Posts:
    61
    So I created a new wallet with the AppCoins BDS on the test device.
    Still no joy. We are going ahead to submit the app anyway because IAP is not that important in our game, but we should find a solution for this problem.

    I was thinking maybe unity should roll their own IAP payment system, then enlist the distribution platforms to partner with them on the backend (think ads mediation but now you do IAP mediation), such that developers only need to integrate one unity IAP, and it works for all platform, without all the repackaging. Just a suggestion. It's much easier that way too since it will work as expected across different distribution platforms.
     
  7. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
    Hi there! I know I'm late to the party. I'm having the same issue; my APK works fine before repacking with UDP IAPs working (when logged in with test account and I request to buy, it instantly triggers a successful buy - which I imagine is the expected behavior?).

    However, after repacking for Catappult, I'm having the same error mentioned in the previous posts above, and nothing is triggered in the game.

    Any ideas of where this could be coming from and how it could be solved? The app hasn't been approved on the store yet, but IAPs are indeed already listed on the Catappult dev console.
     
  8. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
    OK, now it seems like initialization succeeds; the log say so. However, when I click on an IAP button, nothing happens, and nothing is shown in the logcat either. Weird, right?

    Would someone have an idea of what I might have missed for the repacking to work successfully? I'm in IL2CPP, maybe it only works with Mono? It works fine before repacking, I'm a bit lost right now as I have no log info / no error, just no reaction upon clicking buy buttons.

    Thanks in advance!
     
  9. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    6,908
  11. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
  12. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
    OK, by re-checking config and code, I managed to get that:
    - Initialization is OK
    - Upon querying inventory to check for previous purchases, I get:

    Code (CSharp):
    1. AndroidJavaException: java.lang.NullPointerException: Attempt to get length of null array
    2. 01-06 14:16:44.131 22881 22909 E Unity   : java.lang.NullPointerException: Attempt to get length of null array
    3. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity.udp.sdk.provider.aptoide.AptoideProviderService.queryInventory(AptoideProviderService.java:89)
    4. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity.udp.sdk.internal.ChannelHandler.startQueryInventory(ChannelHandler.java:116)
    5. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity.udp.sdk.ChannelService.queryInventory(ChannelService.java:163)
    6. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    7. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity3d.player.UnityPlayer.c(Unknown Source)
    8. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source)
    9. 01-06 14:16:44.131 22881 22909 E Unity   :      at android.os.Handler.dispatchMessage(Handler.java:98)
    10. 01-06 14:16:44.131 22881 22909 E Unity   :      at android.os.Looper.loop(Looper.java:148)
    11. 01-06 14:16:44.131 22881 22909 E Unity   :      at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
    12. 01-06 14:16:44.131 22881 22909 E Unity   :   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
    13. 01-06 14:16:44.131 22881 22909 E Unity   :   at UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
    Seems like it's because the list of purchased product is null (new test account). Would that be because Aptoide doesn't support inventory query? In which case, how can I check if it's not supported?

    Thanks in advance for your help!
    Charles
     
  13. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    42
    OK, I can now confirm that if I never try to request billing products (which I understood should be done to at least once to check if any previous purchases were done by the user after reinstall), the purchasing works fine. That's progress :)

    However, I'm not sure how to handle the QueryInventory if it always throws an error when called. Any ideas?

    Thanks!
    Charles
     
unityunity