Search Unity

[Unity 2018.3] Android 4.x 5.x IL2CPP Crash UnityIAP

Discussion in 'Unity IAP' started by nyanpaz, May 21, 2019.

  1. nyanpaz

    nyanpaz

    Joined:
    Jan 30, 2018
    Posts:
    3

    ===============================================

    [Android 4.x]

    05-21 19:57:49.161 6052-6090/? E/dalvikvm: Could not find class 'java.lang.invoke.MethodHandles$Lookup', referenced from method com.unity3d.player.ReflectionHelper$1.a
    05-21 19:57:49.161 6052-6090/? W/dalvikvm: VFY: unable to resolve const-class 8911 (Ljava/lang/invoke/MethodHandles$Lookup;) in Lcom/unity3d/player/ReflectionHelper$1;
    05-21 19:57:49.173 6052-6090/? I/UnityIAP: IAB helper created.
    05-21 19:57:49.609 6052-6090/? I/UnityIAP: Starting in-app billing setup.
    05-21 19:57:49.917 6052-6052/? I/UnityIAP: Billing service connected.
    05-21 19:57:49.917 6052-6197/? I/UnityIAP: invoking callback
    05-21 19:57:49.917 6052-6197/? I/UnityIAP: Checking for in-app billing 3 support.
    05-21 19:57:49.917 6052-6197/? I/UnityIAP: onIabSetupFinished: 3
    05-21 19:57:49.917 6052-6197/? I/UnityIAP: Failed to setup IAB. Notifying Unity...

    ===============================================

    [Andorid 5.x]
    05-21 19:57:27.598 2094-2160/? E/Unity: OverflowException: Value is greater than Char.MaxValue or less than Char.MinValue
    at System.Convert.ToChar (Int32 value) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.MiniJSON.Json+Parser.EatWhitespace () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.MiniJSON.Json+Parser.get_NextToken () [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.MiniJSON.Json+Parser.Parse (System.String jsonString) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.JSONSerializer.DeserializeProductDescriptions (System.String json) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.JSONStore.OnProductsRetrieved (System.String json) [0x00000] in <filename unknown>:0
    at UnityEngine.Purchasing.Extension.UnityUtil.Update () [0x00000] in <filename unknown>:0

    (Filename: currently not available on il2cpp Line: -1)

    ===============================================

    When using UnityIAP, an error is output on that Android version.
    I'd like to know if know how to resolve this issue.
    Please help me.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,418
    Please provide more information. Was it working previously? What changed? What version of IAP? Does it work in Mono? Does it work on any Android system? As the error indicates, do you have Descriptions configured for all your IAP products? Just posting an error message is generally not that useful, with no additional context.
     
  3. nyanpaz

    nyanpaz

    Joined:
    Jan 30, 2018
    Posts:
    3
    First of all, thanks for reply. We are using UnityIAP 1.22 When Scripting Backend were Mono, it was compatable to all Android. But when we changed Scripted Backend to IL2CPP, it will error out on Android 4.x and 5.x make it unable to initialise in-app purchase. Currently we are using Mono to temporary fixed this problem. Because of the problem of 64-bit architecture with google play store, after august 1st we need to compile using IL2CPP. There is no problem found after Android Marshmellow though.
     
  4. hakan7373

    hakan7373

    Joined:
    Nov 19, 2015
    Posts:
    13
    same here, hope fixed soon!
     
  5. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    16
    I have the same problem.

    I fill shop with products when shop is initialized (and local prices are available) and some players report that their shop is empty. I assume it's because of this issue.
     
  6. kamicompute

    kamicompute

    Joined:
    Jun 5, 2019
    Posts:
    6
    I have a similar issue when moving to IL2CPP. I found that if I kill the app manually after closing it (Android keeps it running in the background, so swipe it up / close all etc to kill it), the logon and initialization works properly. Could you confirm this is also the case for you?

    Happy to hear I'm not alone on this issue.
     
  7. kamicompute

    kamicompute

    Joined:
    Jun 5, 2019
    Posts:
    6
  8. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    16
    My problem occurs on startup.
    Few frames after the start "OverflowException: Value is greater than Char.MaxValue or less than Char.MinValue" occurs.
    It has nothing to do with closing the app...
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,418
    Is this on Android 4 or 5 (the topic of this thread)? If you search here for your error, I believe you'll find the cause may be due to non-US locale.
     
    Last edited: Jun 6, 2019
  10. nyanpaz

    nyanpaz

    Joined:
    Jan 30, 2018
    Posts:
    3
  11. Prophet1111

    Prophet1111

    Joined:
    Mar 16, 2016
    Posts:
    16
    It's Android 5 related issue (OverflowException).
    I don't have my shop translated to another language but I do use localized strings to show prices (for example 29,99zł in Poland).